PushNotificationsProvider
@objc(ZDKPushNotificationsProvider)
public final class PushNotificationsProvider : NSObject, HasStorage, Loggable, Publisher
The ZDKPushNoticiationProvider
provides APIs to subscribe to, and handle Zendesk Chat’s Push Notifications.
There are two types of chat notifications:
chat.msg
- received when a new chat message was sent from an agentchat.end
- received when the current chat session ends.
-
The
NSNotification.Name
associated with the message received push notificiationDeclaration
Swift
@objc public static let ChatMessageReceivedNotification: NSNotification.Name
-
Received push notification is processed by Chat SDK.
There are two types of chat notifications:
chat.msg
- received when a new chat message was sent from an agentchat.end
- received when the current chat session ends.
Declaration
Swift
@objc public func didReceiveRemoteNotification(_ userInfo: [AnyHashable : Any], in application: UIApplication)
Parameters
userInfo
A dictionary that contains information related to the remote notification
application
The centralized point of control and coordination for apps running in iOS.
-
Returns
true
if received push notification belongs to Chat SDKDeclaration
Swift
@objc public func isChatPushNotification(_ userInfo: [AnyHashable : Any]) -> Bool
Parameters
userInfo
A dictionary that contains information related to the remote notification
-
Registers device token with Zendesk Chat
Declaration
Swift
@objc public func registerPushToken(_ pushTokenData: Data)
Parameters
pushTokenData
device token received in
didRegisterForRemoteNotificationsWithDeviceToken
after registration. -
Registers device token with Zendesk Chat
Declaration
Swift
@objc public func registerPushTokenString(_ pushTokenString: String)
Parameters
pushTokenString
device token received in
didRegisterForRemoteNotificationsWithDeviceToken
after registration.
-
Unregisters for Push notifications
Declaration
Swift
@objc public func unregisterPushToken()