Skip to content

Instantly share code, notes, and snippets.

@nbhasin2
Last active May 10, 2021 01:55
Show Gist options
  • Select an option

  • Save nbhasin2/d8dadf8a870c5563ca4b9f9428477637 to your computer and use it in GitHub Desktop.

Select an option

Save nbhasin2/d8dadf8a870c5563ca4b9f9428477637 to your computer and use it in GitHub Desktop.
Local Notification Swift Permission
let center = UNUserNotificationCenter.current()
center.getNotificationSettings { permission in
switch permission.authorizationStatus {
case .authorized:
print("Authorized")
case .denied:
print("Denied")
case .ephemeral:
print("Temporary notification for App Clips")
case .notDetermined:
print("Not asked")
case .provisional:
print("Authorized to post non-interruptive notification")
default:
print("Unknown")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment