如何以编程方式禁用iOS推送通知分组?

时间:2018-11-22 11:40:29

标签: ios push-notification apple-push-notifications

有设置可以在ios中禁用推送通知分组。但是我想以编程方式禁用该通知。有什么办法吗?

1 个答案:

答案 0 :(得分:1)

我见过的唯一解决方案是为通知分配不同的组,尽管我不确定这是最好的:

let notificationContent = UNMutableNotificationContent()
notificationContent.title = "Hello!"
notificationContent.body = "Test notification"
notificationContent.sound = UNNotificationSound.default
notificationContent.threadIdentifier = "random_thread_identifier"
notificationContent.summaryArgument = ""