Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.77 KB | None | 0 0
  1. class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {
  2.  
  3. var window: UIWindow?
  4.  
  5. func applicationDidFinishLaunching(application: UIApplication) {
  6.     UNUserNotificationCenter.currentNotificationCenter().delegate = self
  7. }
  8.  
  9.  
  10. func userNotificationCenter(center: UNUserNotificationCenter, willPresentNotification notification: UNNotification, withCompletionHandler completionHandler: (UNNotificationPresentationOptions) -> Void) {
  11.  
  12.     print("willPresent")
  13.     completionHandler([.Badge, .Alert, .Sound])
  14. }
  15.  
  16. func userNotificationCenter(center: UNUserNotificationCenter, didReceiveNotificationResponse response: UNNotificationResponse, withCompletionHandler completionHandler: () -> Void) {
  17.  
  18.     print("didReceive")
  19.     completionHandler()
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement