First time user of sending android Push messages from rails server.
Using https://github.com/sghael/speedy_c2dm
Have registered my project with Google and with the project ID getting the Registration_ID of the Android device.
Now, trying test.rb below, but nothing gets sent to phone.
require 'rubygems'
require 'bundler'
Bundler.setup(:default, :development)
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'speedy_c2dm'
TEST_EMAIL = "my_push_email@gmail.com"
TEST_PASSWORD = "MY_PASSWORD"
TEST_REGISTRATION_ID = "DEVICE_TOKEN_RECEIVED_FROM_PHONE"
speedyC2DM = SpeedyC2DM::API.new(TEST_EMAIL, TEST_PASSWORD)
options = {
:registration_id => TEST_REGISTRATION_ID,
:message => "Hi!",
:extra_data => 42,
:collapse_key => "some-collapse-key"
}
response = speedyC2DM.send_notification(options)
Any suggestion.. if I am missing anything..?
speedy_c2dm 1.0.2But as documentation says you should Use
GCMInstead.