Here we list all API calls
for the
## Pubnub.new(pub_key, sub_key) pubnub = Pubnub.new( 'publish_key', 'subscribe_key' )
Grab your API Keys with the link below. Get API Keys You only need the Publish and Subscribe Keys. Ignore the Secret Key.
## pubnub.publish( options )
pubnub.publish({
'channel' => 'my_channel',
'message' => { 'my_var' => 'my text data' }
})
## pubnub.subscribe( options )
pubnub.subscribe({
'channel ' => 'my_channel',
'callback' => lambda do |message|
puts(message['my_var']) ## print message
return true ## keep listening?
end
})
## pubnub.history( options )
messages = pubnub.history({
'channel' => 'my_channel',
'limit' => 10
})
That's it! Super simple right? For extra detail of the Ruby Push API Framework, follow this blog link below. Detailed Blog Ruby Push API