General
callbacks are a great way to keep your back end always informed of interesting events in your application.
You can can supply a callback URL through the admin console to listen for the following events in the system:
The request is built similar to the remote 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
Fired every time a device was registered into the system using the SDK.Notice – this
...
...
...
The parameters are equal to those being sent from the device.
Event name for the Cmd parameter: DeviceRegistered
...
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 be DeviceRegistered for 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 minutes. For example, UTC +01:00 will be 60 |
...
{ "SecretToken": "YOUR SECRET TOKEN", "Cmd" : "DeviceUnregistered", "PushToken": "some push token", "DeviceId": "79848", "DeviceType": 2, "OSVersion": "7.1", "DeviceDescription": "iPhone 5s", "SDKVersion": "1", "AppVersion" : "3.1.3", "TimeZone" : 240 } |
Device unregistered
Fired when device removed the option to receive notifications - through the SDK.
Event name for the Cmd parameter: 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 be DeviceUnregisteredfor 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" : "DeviceUnregistered", "DeviceId": "79848" } |