Page tree
Skip to end of metadata
Go to start of metadata

General

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

You 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 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.

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

NameTypeDescription
SecretToken StringThe token received from PushApps for using the Remote API
CmdStringThe event name which was fired. 
Needs to be DeviceRegistered for this event
PushToken StringThe token received from Google or Apple by the device
DeviceId StringA unique string within this app to identify this device. Could be the IMEI in Android for example or UDID on iOS
CustomIdStringCustom id that represents the device.
DeviceType DeviceType 
OSVersion StringThis device operating system version
SDKVersion StringPushapps sdk version
DeviceDescription StringThe hardware of the device, i.e "iPhone 5"
AppVersion StringThis app current version
TimeZoneIntThe device's offset from UTC in minutes. For example, UTC +01:00 will be 60

Request example

 

{
"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

NameTypeDescription
SecretToken StringThe token received from PushApps for using the Remote API
CmdStringThe event name which was fired. 
Needs to be DeviceUnregistered for this event
DeviceId StringA 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" 
}

Notification created

Fired once a notification was created, by the Admin console or the Remote Server API.

Event name for the Cmd parameter: NotificationCreated

Arguments

NameTypeDescription
SecretToken StringThe token received from PushApps for using the Remote API
CmdStringThe event name which was fired. 
Needs to be NotificationCreated for this event
MessageStringMessage that was provided for the notification
LinkStringLink that was provided for the notification
CustomJsonStringCustomJson that was provided for the notification
CustomJsonKeyStringCustomJsonKey that was provided for the notification
PlatformFeaturesPlatformFeaturesPlatformFeatures that were provided for the notification

Request example

 

{
 "Cmd": "NotificationCreated",
 "SecretToken": "YOUR SECRET TOKEN",
 "Message": "Hello World",
 "Link": "www.pushapps.mobi",
 "CustomJson": "myValue",
 "CustomJsonKey": "myKey",
 "PlatformFeatures": {
 "iOSBadge": "1",
 "iOSSound": "default",
 "iOSNewsstand": false,
 "iOSContentAvailable": "0",
 "AndroidTitle": "My App",
 "AndroidSound": "filename.ogg"
}
}

  • No labels