Skip to content

Instantly share code, notes, and snippets.

@ataka
Created July 29, 2015 00:39
Show Gist options
  • Save ataka/aa8feb023c1dcc5183e3 to your computer and use it in GitHub Desktop.
Save ataka/aa8feb023c1dcc5183e3 to your computer and use it in GitHub Desktop.
Print deviceToken to console
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
let trimCharacterSet = NSCharacterSet(charactersInString: "<>");
let deviceTokenString = deviceToken.description.stringByTrimmingCharactersInSet(trimCharacterSet)
.stringByReplacingOccurrencesOfString(" ", withString: "", options: nil, range: nil);
println("application:didRegisterForRemoteNotificationWithDeviceToken: " + deviceTokenString);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment