Iphone device token - NSData or NSString -


I am receiving the iPhone Device Token as the 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];  

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

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

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

kernel - How to create a "Block device" in Windows -