我的应用程序中有设置,因为我有一个切换按钮,用于在接收远程通知时打开和关闭声音和振动。下面是我在注册远程通知的代码AppDelegate
let notificationTypes: UIUserNotificationType = [UIUserNotificationType.Alert, UIUserNotificationType.Sound]
let pushNotificationSettings = UIUserNotificationSettings(forTypes: notificationTypes, categories: nil)
application.registerUserNotificationSettings(pushNotificationSettings)
application.registerForRemoteNotifications()
对于声音,我提到了从通知中删除声音,但它似乎不起作用。
Whatsapp 有这个功能,所以肯定会
任何人都可以在这方面提供建议吗?