Skip to content

Instantly share code, notes, and snippets.

@brunojppb
Created August 4, 2015 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunojppb/da7762acec0b9b391ad4 to your computer and use it in GitHub Desktop.
Save brunojppb/da7762acec0b9b391ad4 to your computer and use it in GitHub Desktop.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Register for push notifications
let notificationTypes: UIUserNotificationType = .Badge | .Sound | .Alert
let notificationSettings = UIUserNotificationSettings(forTypes: notificationTypes, categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(notificationSettings)
// Ask user permission
UIApplication.sharedApplication().registerForRemoteNotifications()
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment