Activation Android SDK 1.0.0
The first public release of the Actual Activation SDK for Android. This page highlights the public APIs available in 1.0.0.
Newer releases are available. Start new integrations on the latest Activation Android SDK 1.1.1. For the API rework since 1.0.0 and the full migration guide, see 1.1.0.
Installation
The SDK is distributed under the com.actualplatform group. Add the BOM and the activation module — the BOM keeps every Activation artifact on a matching version, so you never declare individual versions.
dependencies {
implementation(platform("com.actualplatform:activation-bom:1.0.0"))
implementation("com.actualplatform:activation")
}
Public API highlights
Client configuration
ActivationClient is a singleton you configure once with the user's identity and your reward-currency settings. At least one of hashedEmail or hashedPhone must be set before the offer wall can load promotions.
In 1.0.0, reward currency is configured through four separate properties on the client.
- Kotlin
- Java
ActivationClient.instance.apply {
hashedEmail = userHashedEmail
clientUserId = "user-123"
// Reward currency — four individual properties.
rewardCurrencyName = "Coins"
rewardCurrencyPerDollar = 100.0
rewardPayoutPercentage = 0.6
rewardIcon = coinIconBytes // ByteArray?
}
ActivationClient client = ActivationClient.getInstance();
client.setHashedEmail(userHashedEmail);
client.setClientUserId("user-123");
// Reward currency — four individual properties.
client.setRewardCurrencyName("Coins");
client.setRewardCurrencyPerDollar(100.0);
client.setRewardPayoutPercentage(0.6);
client.setRewardIcon(coinIconBytes); // byte[]
A RewardCurrency data class is also available, with a RewardCurrency.default() factory for default values.
Observing rewards
Rewards earned during the offer flow are emitted on ActivationClient.instance.rewards, a SharedFlow. In 1.0.0 each reward exposes a single Float amount, and comes in three kinds: Boost, Promotion, and ScanFinished.
lifecycleScope.launch {
ActivationClient.instance.rewards.collect { reward ->
when (reward) {
is Rewards.Boost -> credit(reward.amount) // Float
is Rewards.Promotion -> credit(reward.amount)
is Rewards.ScanFinished -> credit(reward.amount)
}
}
}
Offer wall
OffersWallFlow is a Jetpack Compose composable that hosts the full offer-and-scan experience. In 1.0.0 it accepts an OffersWallStyle for per-call styling, plus a set of result callbacks. Your onScanReceipt callback launches your camera flow and returns a ScanReceiptResult.
OffersWallFlow(
style = OffersWallStyle.default(
wallTitle = { Text("Earn Rewards") },
),
onScanReceipt = {
// Launch your scan flow, then return the parsed results.
ScanReceiptResult(scanResults = scanResults)
},
onScanSuccess = { /* user finished the receipt summary */ },
onError = { e -> /* handle ActivationException */ },
onClose = { /* user dismissed the flow */ },
onNavigationStateChange = { state -> /* analytics, UI coordination */ },
)
An optional scan reward can be attached with ScanReward(reward = 100), where reward is an Int?.
OffersWallFlow is a Compose UI, so it is hosted from Kotlin. Java callers can host it from a setContent { } block in their Activity or Fragment.