Created
August 20, 2019 07:42
-
-
Save susanna2222/433bb64b9e81016f2e222afd94aa136e to your computer and use it in GitHub Desktop.
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
func setupUserNotificationCenter(){ | |
// request to receive notification | |
notificationCenter.requestAuthorization(options: [.alert, .sound, .badge, .carPlay], completionHandler: { (granted, error) in | |
if (error != nil) { | |
print("Notification Authorization Error: " + error!.localizedDescription) | |
}else{ | |
print("Notification Authorization Granted: " + granted.description) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment