Created
January 25, 2020 14:57
-
-
Save KanshuYokoo/975f9fd73e749aadc0e38c20949402c8 to your computer and use it in GitHub Desktop.
ios device token: obective-c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { | |
NSUInteger dataLength = deviceToken.length; | |
const unsigned char *dataBuffer = (const unsigned char *)deviceToken.bytes; | |
NSMutableString *hexString = [NSMutableString stringWithCapacity:(dataLength * 2)]; | |
for (int i = 0; i < dataLength; ++i) { | |
[hexString appendFormat:@"%02x", dataBuffer[i]]; | |
} | |
let token = [hexString copy]; | |
//continue writing code ..... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment