change method to get device token as string

This commit is contained in:
Artem Osadchuk 2019-06-24 17:50:45 +03:00
Родитель 5054841e35
Коммит 4b422ba321
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -79,11 +79,14 @@ NSString* const _UserAgentTemplate = @"NOTIFICATIONHUBS/%@(api-origin=IosSdk; os
- (NSString *)convertDeviceToken:(NSData *)deviceTokenData
{
NSString* newDeviceToken = [[[[[deviceTokenData description]
stringByReplacingOccurrencesOfString:@"<"withString:@""]
stringByReplacingOccurrencesOfString:@">" withString:@""]
stringByReplacingOccurrencesOfString: @" " withString: @""] uppercaseString];
return newDeviceToken;
const char *data = [deviceTokenData bytes];
NSMutableString *newDeviceToken = [NSMutableString string];
for (NSUInteger i = 0; i < [deviceTokenData length]; i++) {
[newDeviceToken appendFormat:@"%02.2hhx", data[i]];
}
return [newDeviceToken copy];
}
- (void) registerNativeWithDeviceToken:(NSData*)deviceTokenData tags:(NSSet*)tags completion:(void (^)(NSError* error))completion;