Skip to content

Instantly share code, notes, and snippets.

@Bucimis
Created September 25, 2019 22:06
Show Gist options
  • Save Bucimis/497ccb3745ce66d45c9e63df45c147ed to your computer and use it in GitHub Desktop.
Save Bucimis/497ccb3745ce66d45c9e63df45c147ed to your computer and use it in GitHub Desktop.
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
if (deviceToken.count == 0) {
print("Device token length was 0. Doing nothing.")
return;
}
let deviceTokenString = deviceToken.map { String(format: "%02x", $0) }.joined()
print("Registering device token with Braze: " + deviceTokenString)
Appboy.sharedInstance()!.registerPushToken(deviceTokenString)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment