Skip to content

Instantly share code, notes, and snippets.

@anand9
Last active December 14, 2015 01:39
Show Gist options
  • Save anand9/5008119 to your computer and use it in GitHub Desktop.
Save anand9/5008119 to your computer and use it in GitHub Desktop.
sending push notifications
require 'eventmachine'
require 'faye'
message = "Hello world"
EM.run {
client = Faye::Client.new('http://0.0.0.0:9292/faye')
client.publish('/anand9_calendar', 'text' => message) | #a unique id is used as the channel name like calendar id
puts "pushed #{message}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment