0
UNNotificationAction *shopAction = [UNNotificationAction actionWithIdentifier:@"ShopNow"
title:@"Shop Now ️" options:UNNotificationActionOptionNone];
UNNotificationAction *dismissAction = [UNNotificationAction actionWithIdentifier:@"Dismiss"
title:@"Dismiss" options:UNNotificationActionOptionDestructive];
UNNotificationCategory *shopCategory = [UNNotificationCategory categoryWithIdentifier:@"Shopping"
actions:@[shopAction,dismissAction] intentIdentifiers:@[]
options:UNNotificationCategoryOptionNone];
NSSet *categories = [NSSet setWithObjects:shopCategory, nil];
[[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:categories];
我試過上面的代碼,但在我的推送通知中不顯示按鈕。通過按鈕給出iOS 10推送通知的任何建議或示例。設置推送通知操作按鈕