Connect native identity, isolate sessions and check Play purchase availability.
API v1Updated
1. Install the native SDK
Integrate the indiana source module from packages/android into Gradle. Use the module Gradle configuration for Android SDK, Kotlin and Play Billing dependencies.
Source packages are currently available. See version information for distribution and protocol requirements. Connect Customer sessions and readHoldings before adding Funnel.
Your backend verifies the app login, then identifies the customer and issues a short-lived customerToken using a Server Key bound to this App and Sandbox. Do not trust a customer identity supplied by the device.
Configure the HTTPS API URL, App UUID and Sandbox environment. Use only a Customer Token in the app; keep Server Keys and Console sessions in their trusted environments.
The SDK keeps the token in memory. Refresh through your authenticated backend. Clear current customer data and authenticate again after 401 / 403.
1import android.content.Context2import ai.tinkerland.indiana.*3import java.util.UUID45suspend fun connectIndiana(context: Context, baseUrl: String,6 projectId: UUID, customerToken: String, runToken: String): Pair<IndianaClient, IndianaFunnelSession> {7 val client = IndianaClient(context, IndianaConfiguration(baseUrl,8 IndianaScope(projectId, IndianaEnvironment.SANDBOX)))9 client.identify(customerToken)10 client.readHoldings()11 return Pair(client, client.funnel(runToken))12}1314// Add IndianaFunnelView(activity, flow) to the host UI on its main thread.15// Authenticate the Customer before starting the Run; its Customer never changes.16// Set onEvent for authored native events.17// Store purchase/restore requires an explicitly supported server release.18// On sign-out: client.reset(); destroy the old Funnel view; client.close()
Connection checkpoint
Show connected only after readHoldings succeeds for the current customer. Preserve decimal credits. Cancel host tasks on account changes or navigation, reject late responses and clear the previous snapshot as a whole.
4. Check store availability
Apple/Google purchase, notification and restore are not yet available as a complete integration. Connect Customer sessions and holdings first. Enable store purchases only when a supported release is available.
5. Check results and recover
Integration checks
Scenario
Expected result
First connection
Holdings match Console customer details; invalid, expired and cross-scope sessions are rejected.
Sign-out and account change
Clear old data immediately; old requests cannot overwrite the new customer; authenticate again after restart.
Network loss and timeout
Show a retryable error without success; retry the original request after reconnection.
Purchase, restore and refund
Deliver a real Sandbox transaction once; restoration does not duplicate grants; verified refunds and revocations reach entitlements and history.
Integration checks
First connection
Expected result
Holdings match Console customer details; invalid, expired and cross-scope sessions are rejected.
Sign-out and account change
Expected result
Clear old data immediately; old requests cannot overwrite the new customer; authenticate again after restart.
Network loss and timeout
Expected result
Show a retryable error without success; retry the original request after reconnection.
Purchase, restore and refund
Expected result
Deliver a real Sandbox transaction once; restoration does not duplicate grants; verified refunds and revocations reach entitlements and history.
Once store integration is available, test purchase, restore and refund in Sandbox and verify results through readHoldings and transaction status.