Home > AI > IOS > UserNotifications >

getNotificationSettings

func getSetting() {
        center.getNotificationSettings { settings in
            guard (settings.authorizationStatus == .authorized) ||
                  (settings.authorizationStatus == .provisional) else { return }

            if settings.alertSetting == .enabled {
                // Schedule an alert-only notification.
                print("alertSetting")
            } else {
                // Schedule a notification with a badge and sound.
                print("badge and sound")
            }
        }
    }

Leave a Reply