Last active
December 14, 2015 01:39
-
-
Save anand9/5008119 to your computer and use it in GitHub Desktop.
sending push notifications
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
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