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 9 months ago
What’s Next
