ApplicationRemoteNotificationsHandler
@objc(LwayveApplicationRemoteNotificationsHandler)
public protocol ApplicationRemoteNotificationsHandler : AnyObject
The following methods are available for handling application remote notifications.
-
This method should be called in -application:didFinishLaunchingWithOptions: of the application delegate after the SDK has been initialized.
Declaration
Swift
func handleApplication(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]?)
Parameters
application
The singleton application object passed through
-application:didFinishLaunchingWithOptions
.launchOptions
A dictionary indicating the reason the app was launched (if any) passed through -application:didFinishLaunchingWithOptions:.
-
This method should be called in
-application:didReceiveRemoteNotification:
or-application:didReceiveRemoteNotification:fetchCompletionHandler
to handle remote notifications.Declaration
Swift
func handleApplication(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler: @escaping (UIBackgroundFetchResult) -> Void)
Parameters
application
The singleton app object.
userInfo
A dictionary that contains information related to the remote notification.
-
This method should be called in
application(_ application:, didRegisterForRemoteNotificationsWithDeviceToken:)
to initialize remote notifications for the experience updates.Declaration
Swift
func handleApplication(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)
-
Indicates the state of remote notifications listening. Set to
false
to stop receiving remote notifications.Declaration
Swift
var notificationsActive: Bool { get set }