Iphone device token - NSData or NSString -
I am receiving the iPhone Device Token as the The string I find is some funky characters and it looks like when the server side script notifications Sends that token, I have not got anything. Do I need to decode anything else? Regards NSData object when I Tested the notification script function, so I only copied that object from the log and the notifications were fixed. But when I try to do it automatically, I am sending the instrument token as an ASCII encoded string in the form of
self.deviceToken = [[NSString Alloc] initWithData: webDeviceToken encoding: NSASCIIStringEncoding];
OK, I got a solution if anyone If the problem is, forget about ASCII encoding, just string with the following lines:
NSString * deviceToken = [[webDeviceToken description] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInstring: @ "& lt; & Gt; "]]; DeviceToken = [DeviceToken stringBeerplugging occurenceoffstring: @ "" with string: @ ""];
Comments
Post a Comment