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 *)convertDeviceToken:(NSData *)deviceTokenData
{ {
NSString* newDeviceToken = [[[[[deviceTokenData description] const char *data = [deviceTokenData bytes];
stringByReplacingOccurrencesOfString:@"<"withString:@""] NSMutableString *newDeviceToken = [NSMutableString string];
stringByReplacingOccurrencesOfString:@">" withString:@""]
stringByReplacingOccurrencesOfString: @" " withString: @""] uppercaseString]; for (NSUInteger i = 0; i < [deviceTokenData length]; i++) {
return newDeviceToken; [newDeviceToken appendFormat:@"%02.2hhx", data[i]];
}
return [newDeviceToken copy];
} }
- (void) registerNativeWithDeviceToken:(NSData*)deviceTokenData tags:(NSSet*)tags completion:(void (^)(NSError* error))completion; - (void) registerNativeWithDeviceToken:(NSData*)deviceTokenData tags:(NSSet*)tags completion:(void (^)(NSError* error))completion;