Hi arixer,

Well we have implemented a event listener as a call back for receiving the payload for a particular topic, anywhere in the scope of your JavaScript code.

Lets say you have subscribed to a topic called “test”

In order to read the payload coming in the topic “test” here is the sample code

document.addEventListener(“test”,function(event){

console.log(event.topic,event.payload)

});

So basically you can read the payload in following way

document.addEventListener(<name_of_topic_you_have_subscribed>,

function(event){

console.log(event.topic,event.payload)

});

Feel free to reach us in case of any other questions.

Open Source Team

Arcoiris Labs

Specialized in developing Intelligent Smartphone Applications