Updating Notification ID's
Depending on your specific framework, notification ID's can be very mutable. Because the convenience of Privakey CX relies on notifications, it is important to always keep the server up-to-date. To update the server with the latest notification ID, use the udpateDevice() method from within your AppDelegate's notification registration handler.
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let name = UIDevice.current.name
let framework = "your notiication framework. eg firebase, APNS"
let token = deviceToken.base64EncodedString()
self.privakeyCX.updateDevice(name: name, notificationFramework: framework, notificationId: token) { success, error in
if error == nil {
// success
} else {
// error
}
}
}
Updated over 3 years ago