将 packages/android 中的 indiana 源码模块接入 Gradle 工程。Android SDK、Kotlin 和 Play Billing 依赖以模块的 Gradle 配置为准。
目前仅提供源码包。发行方式与协议要求见版本说明;先完成 Customer 会话与 readHoldings,再接入 Funnel。
相关:版本与接入方式
接入原生客户身份、隔离会话并核对 Play 购买支持范围。
将 packages/android 中的 indiana 源码模块接入 Gradle 工程。Android SDK、Kotlin 和 Play Billing 依赖以模块的 Gradle 配置为准。
相关:版本与接入方式
相关:身份与凭据边界
import android.content.Contextimport ai.tinkerland.indiana.*import java.util.UUID suspend fun connectIndiana(context: Context, baseUrl: String, projectId: UUID, customerToken: String, runToken: String): Pair<IndianaClient, IndianaFunnelSession> { val client = IndianaClient(context, IndianaConfiguration(baseUrl, IndianaScope(projectId, IndianaEnvironment.SANDBOX))) client.identify(customerToken) client.readHoldings() return Pair(client, client.funnel(runToken))} // Add IndianaFunnelView(activity, flow) to the host UI on its main thread.// Authenticate the Customer before starting the Run; its Customer never changes.// Set onEvent for authored native events.// Store purchase/restore requires an explicitly supported server release.// On sign-out: client.reset(); destroy the old Funnel view; client.close()连接成功的条件
readHoldings 中的会员与余额全部属于当前客户时才显示已连接。保留小数积分,不按整数取整。用户换号或离开页面时取消宿主任务,拒绝旧会话的迟到响应并整体清理旧快照。
| 场景 | 预期结果 |
|---|---|
| 首次接入 | 持有读取和控制台客户详情一致;非法、过期和跨范围会话被拒绝。 |
| 退出与换号 | 立即清理旧客户数据;旧请求不能覆盖新客户;重启后需重新认证。 |
| 断网与超时 | 保留可重试错误,不显示成功;恢复网络后能重试原请求。 |
| 购买、恢复与退款 | 真实 Sandbox 交易交付一次;恢复不重复授予;经验证退款与撤销反映在权益和账本。 |
接入检查
首次接入
退出与换号
断网与超时
购买、恢复与退款