【发布时间】:2023-03-10 23:59:01
【问题描述】:
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 按钮推送通知的建议或示例。
【问题讨论】:
标签: ios iphone push-notification apple-push-notifications ios10