问题
I implemented push notifications in the AppDelegate.swift class in FCM. Notifications is great, but how do I save the settings in the app when the user changes the notifications settings?
回答1:
You can check notification settings by calling notification delegate method
let notificationCenter = AppDelegate().getNotificationCenter()
notificationCenter.getNotificationSettings(completionHandler: { (setting) in
if(setting.authorizationStatus == .denied){
})
}
Public classes for getting notification.
public static var badge: UNAuthorizationOptions { get } public static var sound: UNAuthorizationOptions { get } public static var alert: UNAuthorizationOptions { get } public static var carPlay: UNAuthorizationOptions { get }
for more : https://developer.apple.com/reference/usernotifications/unauthorizationoptions
let me know is it helpful or not?
来源:https://stackoverflow.com/questions/42618144/how-to-save-the-settings-in-the-app-when-the-user-changes-the-notification-setti