/
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])
, multiple selections available,
Related content
Deep Linking with iOS SDK 5.0 or Later
Deep Linking with iOS SDK 5.0 or Later
More like this
Rich Push Notifications Integration for iOS
Rich Push Notifications Integration for iOS
More like this
iOS Receive Push Payload Details
iOS Receive Push Payload Details
More like this
Add the Mobile Push SDK for Appoxee Standalone
Add the Mobile Push SDK for Appoxee Standalone
More like this
Becoming UNUserNotificationCenterDelegate for Appoxee Standalone
Becoming UNUserNotificationCenterDelegate for Appoxee Standalone
More like this
Rich Push Notifications Integration for Appoxee Standalone
Rich Push Notifications Integration for Appoxee Standalone
More like this