Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Parsing Event Data(not JSON?) #220

Open
DannyBlok opened this issue Jul 21, 2016 · 3 comments
Open

Error Parsing Event Data(not JSON?) #220

DannyBlok opened this issue Jul 21, 2016 · 3 comments

Comments

@DannyBlok
Copy link

DannyBlok commented Jul 21, 2016

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

@twomedia
Copy link

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

@lukeredpath
Copy link
Contributor

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

@twomedia
Copy link

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants