Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 656 Bytes

File metadata and controls

33 lines (25 loc) · 656 Bytes

SmartTV PubNub JavaScript SDK for Sony, Philips, LG, Samsung, Westinghouse and VIZIO!

Simple Example

NOTE: Copy and paste this example into a blank HTML file.

<script src=pubnub.min.js ></script>
<script>(function(){

    var pubnub = PUBNUB.init({
        publish_key   : 'demo',
        subscribe_key : 'demo'
    });

    // LISTEN
    pubnub.subscribe({
        channel : "hello_world",
        message : function(m){ alert(m) },
        connect : publish
    })

    // SEND
    function publish() {
        pubnub.publish({
            channel : "hello_world",
            message : "Hi."
        })
    }

})();</script>