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プッシュ通知の提案や例を挙げてください。プッシュ通知の設定アクションボタン