Skip to content

Instantly share code, notes, and snippets.

@scott-lydon
Last active November 23, 2018 17:01
Show Gist options
  • Save scott-lydon/c06a70a65cdd24162eda9bfbc2ba3e1f to your computer and use it in GitHub Desktop.
Save scott-lydon/c06a70a65cdd24162eda9bfbc2ba3e1f to your computer and use it in GitHub Desktop.
AppDelegate call to registerFor Remote Notifications
//The following line should already be present in your AppDelegate.swift file
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
//Here is the call! Add the next line! It is recommended to ensure the registration is placed on the main thread.
DispatchQueue.main.async {
self.registerForPushNotifications()
}
//This should already be here
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment