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

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -