Last active
May 10, 2021 01:55
-
-
Save nbhasin2/d8dadf8a870c5563ca4b9f9428477637 to your computer and use it in GitHub Desktop.
Local Notification Swift Permission
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
| let center = UNUserNotificationCenter.current() | |
| center.getNotificationSettings { permission in | |
| switch permission.authorizationStatus { | |
| case .authorized: | |
| print("Authorized") | |
| case .denied: | |
| print("Denied") | |
| case .ephemeral: | |
| print("Temporary notification for App Clips") | |
| case .notDetermined: | |
| print("Not asked") | |
| case .provisional: | |
| print("Authorized to post non-interruptive notification") | |
| default: | |
| print("Unknown") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment