Created
May 20, 2019 11:23
-
-
Save leoiphonedev/7ddc383858638de5762850154e514e53 to your computer and use it in GitHub Desktop.
Asking for user permissions in order to send hm notifications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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