-
Notifications
You must be signed in to change notification settings - Fork 28
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
Payload issue after upgrading from 3.1.0
#190
Comments
Hi @kacperd, could you show an example how do you publish a message with your custom payload? |
Unfortunately, I don't have access to the project that publishes messages 😞 |
Here's how you could do it. Let's assume you have your custom struct (or any other type) conforming to our
Then, here's how you could use publish and subscribe methods:
|
Thanks for your help @jguz-pubnub. I think I was not precise enough when I first described the issue. The problem we have is that the Here's the payload we get from PubNub SDK in version
Here's the debugged value of the payload that we received in SDK 7.0.0:
And decoding of the latter fails with:
The payload in What could be the reason for this difference? |
I did a quick test on the newest
Then, I was able to receive expected payload and decode it into raw dictionary:
Another question is, do you publish a Dictionary you mentioned from another endpoint that uses PubNub Swift SDK? Or is it a message from developer console or any other SDK like Java, Kotlin, JavaScript, etc? |
This dictionary is not published by PubNub Swift SDK. It's published by some backend service. I don't have implementation details, but I know that nothing has changed in the way the messages are published. |
Do you use another PubNub SDK on the server side or do you encode a message yourself and manually invoke our rest API and its |
From the information I got, we use PubNub PHP SDK version |
Could you update PHP SDK used on the server side to the newer value? The one you use is quite obsolete. I pasted your payload into our PubNub Developer Console and Debugger (you can try it out by filling up the left panel with your keys, channel and user id), published a message and I had no problems with parsing for both
|
Hello!
In our project, I noticed the issue with messages payload after upgrading to the SDK version
7.0.0
(previously, we were using version3.1.0
). The problem is that the payload no longer represents the correct JSON and our parsing started to fail.Here's the debugged value of the payload that we received in SDK
7.0.0
:It looks like the beginning of the json response was removed and it's no longer interpreted as a valid JSON.
In version
3.1.0
, the payload was a correct JSON.The text was updated successfully, but these errors were encountered: