/
Steps for iOS
Steps for iOS
In order to add your custom categories for notification so you can send push notifications with different buttons and actions behind it you can add it using method “saveUserNotificationCategories“. Here is the example code which needs to be added at AppDelegate method didFinishLaunchingWithOptions:
Objective C:
UNNotificationAction *ok = [UNNotificationAction actionWithIdentifier:@"OK"
title:NSLocalizedString(@"OK", nil)
options:UNNotificationActionOptionForeground];
UNNotificationAction *cancel = [UNNotificationAction actionWithIdentifier:@"CANCEL"
title:NSLocalizedString(@"CANCEL", nil)
options:UNNotificationActionOptionForeground];
NSArray *buttons = @[ ok, cancel ];
// create a category for message failed
UNNotificationCategory *buttonsAction = [UNNotificationCategory categoryWithIdentifier:@"ACTION_BUTTON" actions:buttons
intentIdentifiers:@[]
options:UNNotificationCategoryOptionCustomDismissAction];
[[Appoxee shared] saveUserNotificationCategories:@[buttonsAction]];
Swift:
let CUSTOM_ACTION1 = UNNotificationAction(identifier: "view_now", title: "CUSTOM_ACTION_TITLE", options: .foreground)
let CUSTOM_ACTION2 = UNNotificationAction(identifier: "skip", title: "CUSTOM_ACTION2_TITLE", options: .foreground)
let CUSTOM_CATEGORY = UNNotificationCategory(identifier: " CUSTOM_CATEGORY_NAME", actions: [CUSTOM_ACTION1, CUSTOM_ACTION2], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: "", options: .customDismissAction)
Appoxee.shared()?.saveUserNotificationCategories([CUSTOM_CATEGORY])
Related content
Rich Push Notifications Integration for iOS
Rich Push Notifications Integration for iOS
More like this
Set Application Tag
Set Application Tag
More like this
Add the Mobile Push SDK for Appoxee Standalone
Add the Mobile Push SDK for Appoxee Standalone
More like this
Disable and re-enable Push Notifications for Appoxee Standalone
Disable and re-enable Push Notifications for Appoxee Standalone
More like this
Deep Linking with iOS SDK 5.0 or Later
Deep Linking with iOS SDK 5.0 or Later
More like this
Disable and re enable Push Notifications
Disable and re enable Push Notifications
More like this