Skip to main content

Android SDK (24.3.0-beta1)

Introduction

This guide only includes features introduced in beta versions. For a full SDK guide of the latest stable version, see the Android SDK guide.

The current beta release is 24.3.0-beta1.

The current stable release is 24.2.1.

Accessing the demo App

The Atomic Demo App is where you can view test cards. To run the latest beta version of Atomic Demo app, join the Atomic Connect beta - Play Store.

There is also a stable version of the Atomic Android Demo app. Read more in the Introduction to the workbench.

Installation

The beta SDK can be installed using Gradle. See here. The version number will match the beta release version from above.

For example:

dependencies {
implementation 'io.atomic.actioncards:aacsdk:24.3.0-beta1'
}

Metadata pass-through

Any metadata sent from an API request can now be accessed from within the SDK using the SDK Event Observer, once enabled in the Workbench

info

Currently the metadata is only returned in the card-displayed event.

An example body in an API request to an Action Flow trigger endpoint might look like:

{
"flows": [
{
"payload": {
"metadata": {
"account" : "123445",
"fruit" : "apple"
}
},
"target": {
"type": "user",
"targetUserIds": "user-123"
}
}
]
}

To retrieve the metadata just capture the card-displayed event in an SDK Event Observer, such as:

AACSDK.observeSDKEvents { event ->
when (event.eventName) {
AACEventName.CardDisplayed -> {
event.metadata?.payloadMetadata?.toString()?.let { Logger.debug("Metadata: ${it}") }
}
else -> {
print(event)
}
}
}

Example output: Metadata: {account=123445, fruit=apple}

Any metadata is in the property payloadMetadata of type Map<String, Any> of the metadata object of the event, as demonstrated in the example above.