The latest Sensorberg Android SDK streamlines the conversion integrations.
The main idea of this new API is that the SDK will not assume any state changes
and gives the app developers the freedom to define the specific moment
each conversion state should be changed.
This change also makes the Android SDK more in line with the behavior of the iOS SDK,
that way unifying their presentation on the dashboard on portal.sensorberg.com.
The new conversion API
The following static method have been added to SensorbergSdk class.
The host app is responsible for calling this method on the appropriate moments.
The previous ActionReceiver have been deprecated and removed from the SDK.
And that’s all!
Context is available from BroadcastReceiver and Activity,
the UUID comes from Action.getInstanceUuid() and Conversion is a simple enum with 4 states:
NOTIFICATION_DISABLED - The host app wanted to show a notification, but the user disabled them.
ACTION_SUPPRESSED - The host app received the Action but decided not to act on it. This is useful case the action intention is to simply trigger some background sync on the app.
NOTIFICATION_SHOWN - The host app received the Action and shown a notification to the user.
SUCCESS - The user tapped on the notification. This status is usually updated from inside the host app activity.
Add to the app BroadcastReceiver calls to notifyConversionStatus and add Action meta-data to the notification intent: