Push Notifications over HTTP¶
The HTTP gateway for pushes allows you to send Push Notifications directly. It accepts POST requests and formats a message that is then transferred to Acrobits’s Push Notification Mediator Service and then to the device.
The address of the gateway is
https://pnm.cloudsoftphone.com/pnm2. It accepts only HTTP POST requests and
application/x-www-form-urlencoded body type. In the POST requests it accepts the following parameters.
Required parameters are
DeviceToken. Leaving any of these parameters out will produce a
HTTP 400 error.
- Type of the message. The most important one is
NotifyGenericTextMessage. See Message Types and additional parameters for more information.
- Application ID. This parameter is required
- Identifies the device that will receive the Push. This parameter is required.
You need to properly urlencode the values. For example if your DeviceToken contains plus (
+) you need to replace it with
This message type is used to notify user about incoming messages. It notifies the app that there are new messages available for fetching using the Fetch Messages. When the app receives this type of push message, it runs the fetch web service in the background and when the new messages are fetched, the notification about them is presented to user.
This verb needs additional parameter
Selectorwhich identifies the user’s account. It is reported in the same way as
The simplest message type which is used to show a text notification to user. The app doesn’t process this message in other way other than displaying the text on screen. This can be used for various marketing messages, reminders etc.
The additional parameter
Messagecontains the text to be displayed. See the example below.
This push causes the application to reprovision – reload its configuration from the portal and from external provisioning URL – immediately. No notification to the user is presented.
Send a simple text notification:
wget https://pnm.cloudsoftphone.com/pnm2 --post-data="verb=NotifyGenericTextMessage&Message=Hello%20World&DeviceToken=QVBBOTFiSEQ0KX05PclRXZXlRdTVaNUJXT3BZVmpBMmxR&AppId=cz.acrobits.softphone.cloudphone" -O -
NotifyTextMessage notification to let the app know about new incoming messages:
wget https://pnm.cloudsoftphone.com/pnm2 --post-data="verb=NotifyTextMessage&DeviceToken=LA7U4xm7MqZCVqFPhf4Dz2sILOJ9iVGh0eeTBOyKDRs=&Selector=C203056764290202B7DA6F61B98671616469AEDB:1DA7349B&AppId=com.cloudsoftphone.app" -O -