Skip to content

Instantly share code, notes, and snippets.

@scott-lydon
Last active November 23, 2018 20:04
Show Gist options
  • Save scott-lydon/5fa35f36a19c53109454150d45225e9b to your computer and use it in GitHub Desktop.
Save scott-lydon/5fa35f36a19c53109454150d45225e9b to your computer and use it in GitHub Desktop.
//This function is called when you successfully registered for remote notifs
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
//This is one way we can convert the device token data into a String.
//apns stands for Apple Push Notification Services
let apnsDeviceToken = deviceToken.map {String(format: "%02.2hhx", $0)}.joined()
print(apnsDeviceToken)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment