0

我的应用程序中有设置,因为我有一个切换按钮,用于在接收远程通知时打开关闭声音振动。下面是我在注册远程通知的代码AppDelegate

let notificationTypes: UIUserNotificationType = [UIUserNotificationType.Alert, UIUserNotificationType.Sound]
    let pushNotificationSettings = UIUserNotificationSettings(forTypes: notificationTypes, categories: nil)
    application.registerUserNotificationSettings(pushNotificationSettings)
    application.registerForRemoteNotifications()

对于声音,我提到了从通知中删除声音,但它似乎不起作用。

Whatsapp 有这个功能,所以肯定会

任何人都可以在这方面提供建议吗?

4

1 回答 1

4

请从 JSON 有效负载中删除声音键值。

我刚刚检查过了。这个对我有用。

{"aps":{"alert":"Enter your message","badge":1}}
于 2017-05-02T06:36:31.843 回答