Becoming UNUserNotificationCenterDelegate Observer

Becoming UNUserNotificationCenterDelegate requires forwarding data to iOS SDK.

Notification Delegate: If you choose to become UNUserNotificationCenterDelegate, it will require you to forward its delegate methods to SDK:

Note that after becoming UNUserNotificationCenterDelegate, SDK will only take over after application launch from a killed state.

- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler __IOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) __TVOS_PROHIBITED { [[Appoxee shared] userNotificationCenter:center didReceiveNotificationResponse:response withAppoxeeCompletionHandler:^{ // When the completion handler is called, this means that Appoxee completed it's execution. // Call the completion handler. completionHandler(); }]; }
@available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { Appoxee.shared()?.userNotificationCenter(center, didReceive: response, withAppoxeeCompletionHandler: {   // When the completion handler is called, this means that Appoxee completed it's execution. // Call the completion handler. completionHandler() }) }

And to control the display of notifications in the foreground by yourself.

- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0) { // Choose to display, or not display notifications on foreground. completionHandler(UNNotificationPresentationOptionNone); }