Uni-app

Initialize GoEasy

Integrate goeasy.js sdk.


// Initialize global GoEasy in main.js.
Vue.prototype.$goEasy = new GoEasy({
    host: "hangzhou.goeasy.io",//your application region: [hangzhou.goeasy.io |singapore.goeasy.io]
    appkey: "my_appkey" //Replace it with your own appkey
});

Receive messages

this.$goEasy.subscribe({
    channel: "my_channel", //Replace it with your own channel
    onMessage: function (message) {
        alert("Channel:" + message.channel + " content:" + message.content);
    }
});

Publish messages

this.$goEasy.publish({
    channel: "my_channel", //Replace it with your own channel
    message: "Hello, GoEasy!" //Replace it with your own message
});

results matching ""

    No results matching ""