Last active
March 19, 2017 15:52
-
-
Save insidegui/d9510bb2b567b3f01552bfd303fa0a04 to your computer and use it in GitHub Desktop.
This file contains hidden or 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().requestAuthorization(options: [.alert, .sound]) { authorized, error in | |
guard error == nil, authorized else { | |
// not authorized... | |
return | |
} | |
// subscription can be created now \o/ | |
} | |
UIApplication.shared.registerForRemoteNotifications() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment