Push tokens and device association
Follow this guide when adding push or payment-device features. A consumer device association uses the consumer ID and the SDK's local device serial. The Firebase Cloud Messaging token is mutable association data. Push delivery, Android HCE and iOS Bluetooth preparation use the association. Your app owns Firebase; the SDK does not include it. A basic authenticated wallet read does not need device association.
Obtain the token
Integrate Firebase Messaging in your app and read the registration token. On Android 13 (API 33) and later, request the POST_NOTIFICATIONS permission.
Pass it to the SDK
For those features, supply the token through either entry point, then update it after sign-in and on rotation:
WolletteConfig.registrationTokenat SDK creation, so the token is available as soon as a session exists.setRegistrationTokenafter sign-in and whenever Firebase rotates the token.
sdk.setRegistrationToken(fcmToken, provider)try await sdk.setRegistrationToken(fcmToken, provider: provider)What setRegistrationToken does
- Stores the new token.
- If a login session exists, reads the current association and creates or updates it only when needed. An unchanged token skips the write. Each HTTP attempt uses a fresh developer proof.
| Situation | Outcome |
|---|---|
| No session | Success. No HTTP. Provider not called. Token stored for later |
| Session, provider omitted or first context invalid | VALIDATION. Token stored. No HTTP |
| Blank token | VALIDATION |
| Session and valid provider | Association verified, created or updated as needed |
Signing in does not associate the device. Call this after login or applySession before using features that require association, and whenever the token changes.
Firebase token rotation
Call setRegistrationToken from your Firebase onNewToken handler (Android) or the messaging delegate (iOS) so the association stays current.
Consumer payments
payments.pay requires a token from either source unless the device is already associated; otherwise it throws VALIDATION. See Consumer contactless payments.
The iOS Bluetooth preparation path also requires the current consumer device/account association. See Consumer contactless payments.