pusher/libPusher

Error Parsing Event Data(not JSON?)

Opened this issue · 3 comments

Hi i have the same issue as:
#100 (comment)
I also post a comment there

Sometimes i only return a NSString form Server.
In the PTPusherEvent.m of the Pod.
This function gets called when get something from server:

  • (id)initWithEventName:(NSString *)name channel:(NSString *)channel data:(id)data

But If my data is like this @"/"StringValue/""
It always comes in

if (_data == nil) {
NSLog(@"[pusher] Error parsing event data (not JSON?)");
_data = [data copy];
}
The stringValue that's returning is correct. because it copies
But i want to know why it shows the Log error.
In your comments in the PTPusherEvent.h file says: it can be a simple string
So it's al little bit confusing.
That log is saying error but the code is still working

I'm experiencing this as well... I'm returning a simple string from the server and the client logs this error. Any suggestions would be greatly appreciated <3

This should probably be a warning than an error, but you can safely ignore this.

@lukeredpath I thought that error log indicated something had gone wrong since my event block was never being called... ended up being a typo in the event name! I also made sure the server was returning a valid JSON string so this error log stops appearing! All is good now, thanks!