PushNotifications
@objcMembers
public final class PushNotifications : NSObject
Undocumented
-
Fired for a valid Rezolve AI push notification received in the foreground
Declaration
Swift
public var onNotificationReceived: ((PushPayload) -> Void)? -
Fired when the user taps a valid Rezolve AI push notification from the background
Declaration
Swift
public var onNotificationClicked: ((PushPayload) -> Void)? -
Undocumented
Declaration
Swift
public override init() -
Registers the device token for push notifications. This method should be called from the AppDelegate’s didRegisterForRemoteNotificationsWithDeviceToken method
Declaration
Swift
public func register(_ deviceToken: Data)Parameters
deviceTokenThe device token received from APNs. The token is saved to the keychain. If a project ID is already set, the token is registered with the backend immediately; otherwise it is registered later when the SDK is initialized with a project ID.
-
Notification arrives while app is in foreground Should be called from the AppDelegate’s userNotificationCenter:willPresent:withCompletionHandler: method when a notification is received while the app is in the foreground. It allows the SDK to handle the notification and determine whether it should be presented to the user or not
Declaration
Swift
public func handleForeground(_ notification: UNNotification) -> Bool -
The callback is called when a user clicked the push notification that arrived while the app was on background Should be called from the AppDelegate’s userNotificationCenter:didReceive:withCompletionHandler: method when a notification is received when a user clicked on the push notification It allows the SDK to handle the notification and determine whether it should be presented to the user or not
Declaration
Swift
public func handleResponse(_ notificationResponse: UNNotificationResponse)
View on GitHub
Install in Dash