Created
January 20, 2012 09:10
-
-
Save surendrans/1646309 to your computer and use it in GitHub Desktop.
Push Notification to Android Devices Using speedy_c2dm Ruby Client
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 'speedy_c2dm' | |
require "net/http" | |
require "net/https" | |
C2DM_API_EMAIL = "c2dm_registered@gmail.com" | |
C2DM_API_PASSWORD = "registered email password" | |
SOME_REGISTRATION_ID ="device_id_registered_to_receive_push_notification" | |
p "Setting the email and password" | |
SpeedyC2DM::API.set_account(C2DM_API_EMAIL, C2DM_API_PASSWORD) | |
options = { | |
:registration_id => SOME_REGISTRATION_ID, | |
:message => "Hi!", | |
:extra_data => nil, | |
:collapse_key => "some-collapse-key" | |
} | |
response = SpeedyC2DM::API.send_notification(options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment