Created
August 16, 2016 12:59
-
-
Save janodev/06aff5b9430aa1a674c3c755baf92c57 to your computer and use it in GitHub Desktop.
Handle the notifications
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
@import UserNotifications; | |
extension NotificationManager: UNUserNotificationCenterDelegate | |
{ | |
// Called because the user interacted with a notification. Actions may be dismiss, open, or choosing an action. | |
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: () -> Void) | |
{ | |
print(response) | |
} | |
// Called because a notification was received while the app was in the foreground. | |
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: (UNNotificationPresentationOptions) -> Void) | |
{ | |
// delivers a notification to an app running in the foreground. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment