Notifications
Pre-requisite: The user has to be signed in to perform the following operations.
Register for Push Notifications
To register the device’s push token with InstaVision, the following method can be called. Provider is currently apns only.
Factory.userService.updatePushNotificationToken(token: String, provider: Provider) -> IVPublisher<Void>
Store the APNs Token Locally
The SDK can keep the APNs token in the keychain so it is available after a relaunch without waiting for didRegisterForRemoteNotificationsWithDeviceToken. Storing it does not register it — follow saveAPNSToken with updatePushNotificationToken.
Factory.userService.saveAPNSToken(token: String)
Factory.userService.getAPNSToken() -> String?
Identity Token for Your Own Backend
If a backend of your own needs to verify the same identity the SDK signed in with, The following method returns the current identity token. Pass needRefresh: true to force a refresh.
Factory.userService.getFirebaseToken(needRefresh: Bool) -> IVPublisher<String>