Another attempt to fix push notifications
parent
b695074e19
commit
3e4a5f606e
|
|
@ -26,17 +26,7 @@
|
|||
|
||||
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
|
||||
NSLog(@"Did Register for Remote Notifications with Device Token (%@)", deviceToken);
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
||||
// [deviceToken description] is like "{length = 32, bytes = 0xd3d997af 967d1f43 b405374a 13394d2f ... 28f10282 14af515f }"
|
||||
NSString *token = [self hexadecimalStringFromData:deviceToken];
|
||||
#else
|
||||
// [deviceToken description] is like "<124686a5 556a72ca d808f572 00c323b9 3eff9285 92445590 3225757d b83967be>"
|
||||
NSString *token = [[[[deviceToken description]
|
||||
stringByReplacingOccurrencesOfString:@"<" withString:@""]
|
||||
stringByReplacingOccurrencesOfString:@">" withString:@""]
|
||||
stringByReplacingOccurrencesOfString:@" " withString:@""];
|
||||
#endif
|
||||
PushNotifications::instance()->setAPNSRegistrationToken(QString::fromNSString(token));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue