Our documentation is changing, please click here to enjoy it!
Retrieve custom parameters from Push/In-App/Geofence/Beacons
If you want to retrieve custom parameters from Push, In-App or Inbox features, call:
Code Block |
---|
BMA4S.setCustomParametersListener(your-callback-function) |
Each time a Push/In-App is displayed or clicked, you will receive a response like this one:
Deck of Cards | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Retrieve Push Notification payload
If you want to retrieve the entire push payload, use the following method:
Code Block |
---|
BMA4S.setPushNotificationListener(your-callback-function) |
Here's a payload example for iOS and Android:
Deck of Cards | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
action can contain:
|
| ||||
|
|
categories can contain:
|
| ||||
|
|
Info |
---|
Only our Android SDK is broadcasting BEACON_NOTIFICATIONS and GEOFENCE_NOTIFICATIONS information to third party developer. |
All parameters including your custom parameters are inside params (here we have a custom param named 'my-key')
Geofence/Beacons
For a Geofence/Beacon, you will receive a response like this one :
Code Block |
---|
{ "action":"TRIGGER", "categories":[ "GEOFENCE_NOTIFICATIONS" ], "params":{ "com.ad4screen.sdk.extra.GEOFENCE_PAYLOAD":{ "transition":1, "ids":[ "1921", "4282" ], "triggeringLocation":"{\"latitude\":48.8699786,\"longitude\":2.3347858,\"altitude\":0,\"accuracy\":26.3700008392334,\"bearing\":0,\"provider\":\"fused\",\"speed\":0,\"time\":1454670928159}" } } } |
Here, we have entered 2 geofences.
transition :
- 1 for enter
- 0 for exit
For a beacon, the key will be
Code Block |
---|
com.ad4screen.sdk.extra.BEACON_PAYLOAD |
instead of
Code Block |
---|
com.ad4screen.sdk.extra.GEOFENCE_PAYLOAD |
More details can be found on Android#RetrievingBeaconinformationwithaBroadcastReceiver
Stop listening for custom parameters
If you don't want to retrieve custom parameters anymore, please call:
Code Block |
---|
BMA4S.removeCustomParametersListener() |