First of all, is System.get_property('device_id')
not System.get('device_id')
, this value is going to be empty until GCM has provided an identifier for the device. I am working on this as well. I believe you have to follow these steps:
On the build.yml file add:
capabilities:
- push
Add the push callback to your application, to alert the user, whatever you need to do.
From my understanding when using Rhomobile you cannot use the simulator for pushing messages, so you have to put it on a device. The device will contact the GCM server that it wants to receive pushed messages from your android application.
If you setup your application package to do this, the GCM server will provide an ID to your device, which in turn you have setup to send this id from your device to your server, to be able to push messages to your application for that device. I still need to figure out a couple of things but that is the process. Good Luck!