Message-ID: <1553074635.1232.1408892793814.JavaMail.confluence@centos6.5-prod> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1231_1967799205.1408892793721" ------=_Part_1231_1967799205.1408892793721 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Using callbacks

Using callbacks

General

callbacks are a great way to keep your back end always informed of inter= esting events in your application.

You can supply a callback URL through the&= nbsp;admin console to listen for the following events in the syste= m:


The request is built similar to the Remote Server API - only this time of course the request comes from PushApps system to= your callback URL. 

The request has another argument called "Cmd= " which indicates which event was fired.

 Device registered<= /span>

Fired every time a device was registered into the system using the SDK.<= /p>

Icon

This event might be fired every time device is registered, not only for = the first time. You are in charge of handling multiple events per device in= your system.

The parameters are equal to those being sent from the device. 
Event name for the Cmd parameter: DeviceRegistered

Arguments

Name Type Description
SecretToken  String The token received from PushApps for using the Remote API
Cmd String The event name which was fired. 
Needs to be DeviceRegi= stered for this event
PushToken  String The token received from Google or Apple by the device
DeviceId  String A unique string within this app to identify this device. Could be the IMEI= in Android for example or UDID on iOS
CustomId String Custom id that represents the device.
DeviceType  DeviceType  
OSVersion  String This device operating system version
SDKVersion  String Pushapps sdk version
DeviceDescription  String The hardware of the device, i.e "iPhone 5"
AppVersion  String This app current version
TimeZone Int The device's offset from UTC in mi= nutes. For example, UTC +01:00 will be 60

Request example

 

{
"SecretToken": "YOUR SECRET TOKEN", 
"Cmd" : "DeviceUnregister= ed", 
"PushToken": "some push t= oken", 
"DeviceId": "79848",=  
"DeviceType": 2, 
"OSVersion": "7.1",&= nbsp;
"DeviceDescription": "iPh= one 5s", 
"SDKVersion": "1",&n= bsp;
"AppVersion" : "3.1.3&quo= t;, 
"TimeZone" : 240 
}

 Device unregiste= red

Fired when device removed the option to receive notifications - through = the SDK. 
Event name for the Cmd par= ameter: DeviceUnregistered 

Arguments

Name Type Description
SecretToken  String The token received from PushApps for using the Remote API
Cmd String The event name which was fired. 
Needs to be DeviceUnre= gistered for this event
DeviceId  String A unique string within this app to identify this device. Could be the IMEI= in Android for example or UDID on iOS

Request example

 

{
"SecretToken": "YOUR SECRET TOKEN", 
"Cmd" : "DeviceUnregister= ed", 
"DeviceId": "79848"&= nbsp;
}
------=_Part_1231_1967799205.1408892793721--