Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save susanna2222/b9dfb9b34e7bde3e884b10cd0cde53d0 to your computer and use it in GitHub Desktop.
Save susanna2222/b9dfb9b34e7bde3e884b10cd0cde53d0 to your computer and use it in GitHub Desktop.
func isAllowReceiveNotification() -> Bool{
var isAllow = true
notificationCenter.getNotificationSettings { (settings) in
// Do not schedule notifications if not authorized.
if (settings.authorizationStatus != .authorized || settings.alertSetting != .enabled){
isAllow = false
}
}
return isAllow
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment