/
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
@available(iOS 10.0, *)
private func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: (UNNotificationPresentationOptions) -> Void) {
// Choose to display, or not display notifications on foreground.
completionHandler([])
}
, multiple selections available,
Related content
Firebase Cloud Messaging Support for Mapp Cloud Mobile Integration (DEPRECATED)
Firebase Cloud Messaging Support for Mapp Cloud Mobile Integration (DEPRECATED)
More like this
Release Notes for Mapp Cloud iOS SDK
Release Notes for Mapp Cloud iOS SDK
More like this
Mapp Cloud iOS SDK Documentation
Mapp Cloud iOS SDK Documentation
More like this
Android Application Setup for Mapp Cloud
Android Application Setup for Mapp Cloud
More like this
Mapp Cloud Mobile Integration
Mapp Cloud Mobile Integration
More like this
React-Native Plugin
React-Native Plugin
More like this