Created
August 21, 2019 05:55
-
-
Save susanna2222/cb644269ac5f4ff32028d208320174d3 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
| func setupUserNotificationCenter(){ | |
| notificationCenter.delegate = self | |
| // 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) | |
| self.setupLocalNotificationByRegion() | |
| } | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment