forked from burczyk/XcodeSwiftSnippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUIRemoteNotification.swift
24 lines (16 loc) · 1.16 KB
/
UIRemoteNotification.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//MARK: Remote Notifications
// Move this line somewhere where your app starts
// UIApplication.sharedApplication().registerForRemoteNotifications()
// Ask user for allowed notification types
// let settings = UIUserNotificationSettings(forTypes: .Alert | .Sound | .Badge, categories: nil)
// UIApplication.sharedApplication().registerUserNotificationSettings(settings)
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData!) {
println("Successfully egistered for Remote Notifications with token: \(deviceToken)")
}
func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError!) {
println("Registration for Remote Notifications failed with error: \(error)")
}
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
}
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
}