Used to register and deregister devices with our push notification service. To enable push, see [Push Keys and Certificates](🔗).
### shared
The central object for managing Kustomer push notification-related activities.
### deviceToken
The current device token. May or may not be registered for push notifications.
You need to have put `PushManager.shared.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
` inside your application’s `application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
` method for this to work.
### deviceTokenString
The [`deviceToken
`](🔗) as a UTF8 string
### deregisterCurrentDeviceForPushNotifications(_:)
If the current device has registered for Kustomer push notifications, deregisters it.
Requires an active internet connection.
## Push notifications
### didFailToRegisterForRemoteNotifications(error:)
If you’re using our push notifications, place this in your AppDelegate’s application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) method
### didRegisterForRemoteNotifications(deviceToken:)
If you’re using our push notifications, place this in your AppDelegate’s `func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
`
`deviceToken
`: Pass the `deviceToken
` object that is passed to your AppDelegate
### notificationIsFromKustomer
Tells you if a push notification is from Kustomer. The `threadIdentifier
` of all UNNotifications from our platform is either "kustomer.app.chat" (remote pushes) or "kustomer.app.chat.local" (local push notifications)
### requestAuthorizationForPush()
Asks for permissions to send notifications.
You need to call this before push notifications will work. You can call it as many times as you want. If you’re already using UNUserNotificationCenter.current().center.requestAuthorization(...) somewhere else, you don’t need to call this method.
Source code of this method for advanced push users:
### registerDeviceForPushNotifications()
## UNUserNotificationCenterDelegate
### userNotificationCenter(_:didReceive:withCompletionHandler:)
This gets called when you tap a push notification.
If you have set a `unUserNotificationCenterDelegate
`, your `unUserNotificationCenterDelegate
` will get called if the notification isn’t from Kustomer.
### userNotificationCenter(_:willPresent:withCompletionHandler:)
This gets called when you get a push notification while the app is open. if you have set a `unUserNotificationCenterDelegate
`, your `unUserNotificationCenterDelegate
` will get called if the notification isn’t from Kustomer.