ZendeskSDKMessaging Documentation

Class Push​Notifications

@objc(ZDKPushNotifications)
public final class PushNotifications: NSObject  

The entry point to execute push notification related SDK actions. Register device token with PushNotifications.updatePushNotificationToken(:).

PushNotifications PushNotifications NSObject NSObject PushNotifications->NSObject

Conforms To

NSObject

Methods

update​Push​Notification​Token(_:​)

@objc public static func updatePushNotificationToken(_ token: Data)  

Update a push token to receive push notifications.

Parameters

token Data

The token to be sent to the server.

should​BeDisplayed(_:​)

@objc public static func shouldBeDisplayed(_ userInfo: [AnyHashable: Any]) -> PushResponsibility  

Check if a push notification payload belongs to Messaging and can be displayed.

Parameters

user​Info [Any​Hashable:​ Any]

The push notification payload.

Returns

PushResponsbility enum indiciating if the push notification should be displayed.

handle​Tap(_:​completion:​)

@objc public static func handleTap(_ userInfo: [AnyHashable: Any], completion: ((UIViewController?) -> Void)?)  

Handles the tap of a push notification if the payload belongs to Messaging.

  • The completion is called on the main thread.

  • If Messaging is not initialized the completion will return nil.

  • If Messaging is in the process of being initialized this method will wait, and then a UIViewController will be returned.

  • If Messaging has been initialized a UIViewController will be returned.

Parameters

user​Info [Any​Hashable:​ Any]

The push notification payload.

completion ((UIView​Controller?) -> Void)?

An optional UIViewController instance.