It is possible to configure the notifications Push to an application made with XOne WITHOUT using the XOne Replicator Server component, in such way that the notifications sending is made with an external tool, but the frameworks may detect these notifications, and they can interact with them.
Nowadays, this functionality only is available for Android devices.
The implementation consists of three parts:
The registration of the device in the Cloud must be done for Google Push notifications and sending the Token Push back to the server which is going to make the sending of the notifications.
For this, it is required:
appData.registerPush(function(mEvento) { mEvento.pushToken … });
For more info about how to implement the push messages in an application, please, just follow the following link:
http://developers.google.com/cloud-messaging/downstream
The customer application, will call to the push provider (google - apple) and those ones send the PUSH notification to the device in question.
So they can send us a notification and our framework is able to interpret it, besides the information sent it is necessary to add some “extra” parameters:
The rest of data passed will be the ones received in the device to be processed as we want to, following we show an example of messages:
{ "data": { "datomensaje": "Esto es una prueba", "source": "push_server", "notification_title": "Titulo de la notificacion", "notification_message": "Mensaje de la notificacion" }, "to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdF..." }
To process the Push message we will have to define a “onpushnotificationclick” node in the “Empresas” collection, where we will enter directly when the user clicks on the notification received on the device.
In this node we put a parameter, which in the example we have called “mensajepush”, that will contain the values we have received in the Push message.
datomensaje is the name of one of the data that comes in the Push message of the server.
We can put as many as we need, always keeping in mind that they CANNOT be called with special characters such as spaces, accents, ñ…
<onpushnotificationclick> <action name="runscript"> <param name="mensajepush" /> <script language="vbscript"> ui.showToast "vbscript: " + mensajepush.datomensaje </script> </action> </onpushnotificationclick>
More info about the Replica with Push in here