0
ios 10에는 클래스와 메소드 getNotificationSettingsWithCompletionHandler
이 있으며 UNNotificationSettings
개체가 있고 사용자는 푸시 알림 권한을 요청할 수 있는지 확인할 수 있습니다. iOS 9 및 iOS 8에서이를 달성 할 수있는 방법이 있습니까? .푸시 알림이 결정되지 않았습니다.
ios 10에는 클래스와 메소드 getNotificationSettingsWithCompletionHandler
이 있으며 UNNotificationSettings
개체가 있고 사용자는 푸시 알림 권한을 요청할 수 있는지 확인할 수 있습니다. iOS 9 및 iOS 8에서이를 달성 할 수있는 방법이 있습니까? .푸시 알림이 결정되지 않았습니다.
. 이 기능은 IOS 10부터 사용할 수 있습니다.
이 같은 것을 사용할 수있는 방법이 없습니다
let notificationType = UIApplication.sharedApplication().currentUserNotificationSettings()!.types
if notificationType == UIUserNotificationType.None {
// Push notifications are disabled in setting by user.
} else {
// Push notifications are enabled in setting by user.
}
if notificationType != UIUserNotificationType.None {
// Push notifications are enabled in setting by user.
}
if notificationType == UIUserNotificationType.Badge {
// the application may badge its icon upon a notification being received
}
if notificationType == UIUserNotificationType.Sound {
// the application may play a sound upon a notification being received
}
if notificationType == UIUserNotificationType.Alert {
// the application may display an alert upon a notification being received
}