Comment on page
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.
The guide for creating the push notification certificate+profile and how to export the certificate as a .p12 file can be found here.
Note: Helpful system apis to verify if the registration of remote push notification is successful or not.
These two functions should be in
AppDelegate.swift
file in order to verify the registration of remote push notificationsfunc 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
}
Upon successful registration of device token, the token can be passed to the SDK
PushNotificationService
to set the token on DriveSync.No steps are required on the host app upon receiving silent push notifications except making sure the required permissions are there to facilitate the feature.
- Allow push notification permission
- Will be asked during onboarding
- Background app refresh permission
- Needs to be checked in
info.plist
of the host app
Last modified 2mo ago