Using Push Notifications
Starting with SDK v1.17 the SDK requires a server upgrade in case you are migrating from a previous version (you need to contact IMS for that) and the server requires push notification capabilities.
Steps to follow for using the push notifications for phone only trip detection
App needs to create the push notification certificate with Apple app store connect.
After successful submission of certificate, system will create a unique device token for the respective device
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let deviceTokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)})
debugPrint("DEVICE TOKEN -> \(deviceTokenString)")
// pass the device token to the SDK PushNotificationService
}
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
// indicates registration failed
}The device token needs to be passed to SDK using the PushNotificationService to set the token on DriveSync and the device will be registered to receive push notification from DriveSync.
Once the device token is set to DriveSync, the server will be sending silent push notifications to wake up the app in the background and to improve trip detection.
Required permissions
Last updated