Register Device for Push Notification
π² Push Notification Registration in REL-ID SDK
This guide explains how push notification token registration works in the REL-ID SDK using getDeviceToken and setDeviceToken.
π§ Flow Summary
ββββββββββββββββββββββ
β App receives tokenββββ (from FCM, HCM, or APNS)
ββββββββββ¬ββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββ
β Register with SDK β
βββββββββββββββββββββββββββββββββββββββ€
β For React Native / Flutter / Cordovaβ
β β call `setDeviceToken(token)` β
β β
β For Native Android / iOS β
β β SDK calls `getDeviceToken()` β
β app returns token β
βββββββββββββββββββββββββββββββββββββββ
βΌ
π Token now used for receiving
push-based verification/auth flowsπ Platform-Specific Responsibilities
| Platform | SDK Behavior | App Responsibility |
|---|---|---|
| React Native | Does not auto-fetch token | App must call setDeviceToken() manually |
| Flutter | Does not auto-fetch token | App must call setDeviceToken() manually` |
| Cordova | Does not auto-fetch token | App must call setDeviceToken() manually` |
| Android Native | Calls getDeviceToken() | App must override and return token |
| iOS Native | Calls getDeviceToken() | App must override and return APNS token |
π‘ When to Set the Token
- Immediately after you receive the token from FCM (Firebase), HCM (Huawei), or APNS (Apple Push Notification Service), depending on the platform:
- Before calling any SDK login or activation API
- Ideally during app initialization or on user login
β
Outcome
Once the SDK has the device token:
- It registers the token with REL-ID server
- Your app can now receive push verification notifications
- Used in flows like:
- π Verify Authentication Challenges
- π± Additional Device Activation
- β οΈ Threat Response Flows
Updated 7 months ago
Whatβs Next
