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

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'
}

File upload

info

This is currently a preview feature in Workbench.

A new File Upload card component is now available. This component enables users to select files from their gallery or capture photos directly. Currently, it supports uploading specific image formats, including JPEG, PNG, WebP, and AVIF. Additionally, DNG, TIFF, HEIC, and HEIF files are accepted but will be automatically converted to JPEG upon upload. Please note that GIFs and non-image files are not supported.

When capturing photos through the File Upload component, users will be prompted to grant permission for camera access; without this permission, the camera will be disabled.

There are a couple of new analytics that are introduced to track the activity of the upload.

  • user-file-uploads-started: Emitted when the file upload process begins.
  • user-file-uploads-completed: Emitted upon successful completion of the file upload process, indicating that all files have been uploaded successfully.
  • user-file-uploads-failed: Emitted when the file upload process ends, either due to failure or cancellation.

These events will contain the properties such as name of the upload element, filename and bucket id


"properties": {
"payload": {
"upload_pqliu": {
"fileName": "74eb338d-859c-4122-8a82-87448bb5e04e_1000006964.heif",
"targetBucketId": "DEFAULT"
}
}
}

Observable SDK events


AACSDK.observeSDKEvents(event -> {
StringBuilder payload = new StringBuilder();
payload.append("TimeStamp: ").append(event.getTimestamp()).append(" ");
payload.append("EventId: ").append(event.getIdentifier()).append(" ");
payload.append("UserId: ").append(event.getUserId()).append(" ");
payload.append("ContainerId: ").append(event.getSdkContext().getContainerId() != null ? event.getSdkContext().getContainerId() : "").append(" ");

switch (event.getEventName()) {
case UserFileUploadsStarted:
payload.append("upload ").append(event.getProperties());
break;
case UserFileUploadsCompleted:
payload.append("upload ").append(event.getProperties());
break;
case UserFileUploadsFailed:
payload.append("upload ").append(event.getProperties());
break;
default:
// No payload outside of common
break;
}
});

Configurable strings


// This is the text displayed on the retry toast message when the upload failed
if (viewModel.getStreamContainer() != null) {
viewModel.getStreamContainer().setProcessingStateRetryMessage("Upload failed..");
}

// This is the message displayed on the overlay window during upload
if (viewModel.getStreamContainer() != null) {
viewModel.getStreamContainer().setProcessingStateMessage("Upload is in progress..");
}

// This is the label displayed on cancel button
if (viewModel.getStreamContainer() != null) {
viewModel.getStreamContainer().setProcessingStateCancelButtonTitle("Press to cancel");
}

// This is the text displayed when requesting camera permission which redirects to the settings
if (viewModel.getStreamContainer() != null) {
viewModel.getStreamContainer().setRequestCameraUsageMessage("Access to your camera is required to take photos. Please enable camera access in your device settings");
}

// This is the button text which redirects to the settings
if (viewModel.getStreamContainer() != null) {
viewModel.getStreamContainer().setRequestCameraUsageSettingsTitle("Press to go to settings");
}

Prevent Snoozing Beyond Expiry Date

The SDK will now prevent users from selecting a date and time that exceeds the card's expiry date when snoozing the card.

There are three ways to snooze a card in the Atomic SDK:

  1. Overflow Menu: Click on the "Remind me" overflow menu option and then select a date and time using the integrated selector.
  2. Snooze Button: Tap a snooze button on the card and select a date & time on the snooze activity.
  3. Pre-set Snooze Button: Tap a snooze button with a pre-set snooze period. This snoozes the card instantly.

If a card has an expiry date set, new validation will prevent snoozing the card to a date that matches or exceeds the expiry date, except in scenario 3, where the snooze period is pre-configured from the workbench.

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.