I am new to rails and i wanted to know whether i would be able to change my existing server in rails to a 3rd party application server by adding the gem gcm_on_rails . I have installed the gem in this assumption and have pushed a message to the gcm server using the code in the console
device = Gcm::Device.create(:registration_id =>"APA91bGJSaiKkCm_h9w8prWsL_inTMPs8pmCme8dcLpW0_2AKbny4bTXpx823cCfJLDJmO3_ihiww1ZVK0iqToAlPWKFWcBSraGRw6KNB1PsLYJJWvRZJ3bMP0")
notification = Gcm::Notification.new
notification.device = device
configatron.gcm_on_rails.delivery_format = 'json'
notification.collapse_key = "updates_available"
notification.delay_while_idle = true
notification.data = {:registration_ids => ["APA91bGJSaiKkCm_h9w8prWsL_inTMPs8pmCme8dcLpW0_2AKbny4bTXpx823cCfJLDJmO3_ihiww1ZVK0iqToAlPWKFWcBSraGRw6KNB1PsLYJJWvRZJ3bMP0"], :data => {:message_text => "Get on cloud nine"}}
notification.save
Gcm::Notification.send_notifications
and i am getting the response as
response = {:code=>200, :message=>nil}
but in the documentation of the above gem itself its said that even if the message=>nil
is shown the message might have been send!
I am assuming that the message was send have also created an android application having the aforesaid registerid but also i am not getting any notification
A help on this scenario would be greatly appreciated
thank you