Convert Device ID as NSData to NString in IOS


// function to get device id as string from NSData -(NSString *)convertTokenToDeviceID:(NSData *)token { NSMutableString *deviceID = [NSMutableString string]; // iterate through the bytes and convert to hexunsigned char *ptr = (unsigned char *)[token bytes]; for (NSInteger i=0; i < 32; ++i) { [deviceID appendString:[NSString stringWithFormat:@"%02x", ptr[i]]]; } return deviceID; }

Loading Please Wait...