You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having an issue when I try to send a PNMessage with a message that contains an NSNull value.
I see when I try to send a PNMessage, you're serializing the message using the method PNJSONSerialization +stringFromJSONObject:. This method serializes the object, then starting on line 196 you have
// Replace null value has been passed or not (serialized [NSNull null] value)
if ([JSONString respondsToSelector:@selector(stringByReplacingOccurrencesOfString:withString:)]) {
JSONString = [JSONString stringByReplacingOccurrencesOfString:@":null" withString:@":\"null\""];
}
The problem with this is it's preventing me from properly deserializing the message that is returned in by the PNDelegate method pubNubClient:didReceiveMessage:. Those original NSNull objects are being deserialized to NSStrings with value null.
I tried removing those lines of code and the message is sending and being received as expected now.
The text was updated successfully, but these errors were encountered:
This is not really solution for your issue. Changes should be done on corresponding step - deserialisation. We will include proper fix in future release.
I've been having an issue when I try to send a
PNMessage
with a message that contains anNSNull
value.I see when I try to send a PNMessage, you're serializing the message using the method
PNJSONSerialization +stringFromJSONObject:
. This method serializes the object, then starting on line 196 you haveThe problem with this is it's preventing me from properly deserializing the message that is returned in by the
PNDelegate
methodpubNubClient:didReceiveMessage:
. Those originalNSNull
objects are being deserialized toNSString
s with valuenull
.I tried removing those lines of code and the message is sending and being received as expected now.
The text was updated successfully, but these errors were encountered: