Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoiphonedev/7ddc383858638de5762850154e514e53 to your computer and use it in GitHub Desktop.
Save leoiphonedev/7ddc383858638de5762850154e514e53 to your computer and use it in GitHub Desktop.
Asking for user permissions in order to send hm notifications
UNUserNotificationCenter.current().delegate = self
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in
if granted {
print("User gave permissions for local notifications")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment