Created
August 28, 2013 22:04
-
-
Save dristic/6371910 to your computer and use it in GitHub Desktop.
PubNub basic publish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pubnub = PUBNUB.init({ | |
publish_key: 'demo', | |
subscribe_key: 'demo' | |
}); | |
pubnub.subscribe({ | |
channel: "myChannel", | |
callback: function (message) { | |
console.log("I got the message: " + message); | |
}, | |
connect: function () { | |
pubnub.publish({ | |
channel: "myChannel", | |
message: "Hello World!" | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment