/
Becoming UNUserNotificationCenterDelegate for Appoxee Standalone
Becoming UNUserNotificationCenterDelegate for Appoxee Standalone
Becoming UNUserNotificationCenterDelegate requires forwarding data to Appoxee.
Notification Delegate:
If you choose to become UNUserNotificationCenterDelegate, it will require you to forward its delegate methods to Appoxee:
Note that after becoming UNUserNotificationCenterDelegate, Appoxee SDK will only take over after application launch from a killed state.
Forwarding calls - ObjC
- (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();
}];
}
Forwarding calls - Swift
@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.
Foreground notifications - ObjC
- (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);
}
Foreground notifications - Swift
, multiple selections available,
Related content
Becoming UNUserNotificationCenterDelegate Observer
Becoming UNUserNotificationCenterDelegate Observer
More like this
Disable and re-enable Push Notifications for Appoxee Standalone
Disable and re-enable Push Notifications for Appoxee Standalone
More like this
Request Notification at Best Time for Appoxee Standalone
Request Notification at Best Time for Appoxee Standalone
More like this
Handle Foreground Notifications for Appoxee Standalone
Handle Foreground Notifications for Appoxee Standalone
More like this
iOS Receive Push Payload Details
iOS Receive Push Payload Details
More like this
Silent push for iOS
Silent push for iOS
More like this