I am implementing push notifications. I\'d like to save my APNS Token as a String.
- (void)application:(UIApplication *)application
didRegisterForRemoteNotif
The solution @kulss posted here, while lacking in elegance but having the virtue of simplicity no longer works in iOS 13, since description
will work differently for NSData. You can still use debugDescription
though.
NSString * deviceTokenString = [[[[deviceToken debugDescription]
stringByReplacingOccurrencesOfString: @"<" withString: @""]
stringByReplacingOccurrencesOfString: @">" withString: @""]
stringByReplacingOccurrencesOfString: @" " withString: @""];