The Push API in RhoElements essentially allows you to send http messages to the application (as long as the application is running). Think of it as a web server is listening on a certain port that your application can hook into for notifications. This does not sound like what you are looking for. We do offer RhoConnect Push (as explained in this webinar) but that would require you to implement the RhoConnect solution. We do support native android Google Cloud Messaging out of the box yet, if you want you can enable this and expose it to you application by writing a native extension for it.
Thanks Rob! It sounds like we might be able to make this work.
Robert Galvin wrote:
The Push API in RhoElements essentially allows you to send http messages to the application (as long as the application is running).
Hi Rob, can you elaborate a bit? I've not been able to understand the difference between this and the messages being pushed thru Rhoconnect or GCM.
Here is an example page that is running in a RhoElements Application:
This basically tells the web page to listen to port 8080 for any incoming HTTP requests. From another machine (you can do this in your browser to simulate),you could simply try to browse to http://IPAddressofTheDevice:PortValue/push?param1=val1¶m2=val2
The app would detect it and the 'detected' function would get called because I set push.detected = 'detected(%s,%s)'.
So you would need the following in order for this to work:
1) The device must be accessible via HTTp from the server/sender of the push message
2) The application must be running on the device
3) The server/sender needs to know the IP address of the device.
Thanks, Rob, would this work on my non-Rhoelements and non-webkit and old WM 6 device, because if it does, testing it from a PC would be a piece of cake as plugging in my device to it would automatically make it accessible thru Activesync.
I've loaded up your sample page onto an ET1 (and MC40) but I can't quite get it working. DDM shows the attached error stack for every push sent to a device.
The signal data checks out. I know I'm at least hitting the device, but I'm not sure what else to try. Any ideas?
error.txt.zip 616 bytes
try some of the examples shown in: http://docs.rhomobile.com/rhoelements/push
Although they use META tag implementation, you can do the similar in JS. You can also change the '%s" to '%json and reference the params by name:
push.detected = 'detected(%json)';
Forgot to mention -- I tried the examples from the documentation before I tried your above demo. I also tried the META tag implementation. I always get the same error. Could there be a configuration piece missing? What is the mention of NPAPI/ASL for?
I had a few follow up questions on this (after watching the webinar http://www.youtube.com/watch?feature=player_embedded&v=IeUTjBliLkE#!)
This says it works assuming the application is running. If the application we create that implements RhoMobile Push is running but is not in currently the application in focus or if the screen is off, would be be able to alert the user via an Android notification or vibration/sound when a push message was received?
The solution we are trying to provide would be something similar to the way that application notifications work through GCM, but behind the firewall. Are there any solutions you are aware of that solve this? For example I can get alerts at the OS level that allow us to wake the device, show notifications or while in the application update the application. It seemed easier with C2MD. I am wondering if this push addresses the same use cases or a subset (which are all in the application).