Based on the following function I am able to receive the response,
func client(client: PubNub!, didReceiveMessage message: PNMessageResult!) {
println(message)
But, I am able to access the data only as message.data which is in the format of PNMessageData.
Even that returns the data in following format:
{
message = "{}";
subscribedChannel = 123;
timetoken = 14392105288780634;}
How will I access the value of message inside the message.data(PNMessageData) ?
I have written simple method to parse PNMessageResult
You are very close to accessing the data. The SDK serializes the JSON being received and stores the message as a dictionary on message.data.message which should be a dictionary.
Try this: