Frak
Ce contenu n’est pas encore disponible dans votre langue.
object Frak
Entry point. Call initialize once from Application.onCreate, then use client.
Java callers use Frak.getClient() and the *Async twin of every suspending member.
Properties
Section titled “Properties”| Name | Summary |
|---|---|
| client | val client: FrakClient |
| clientOrNull | val clientOrNull: FrakClient? Same as client, but null instead of throwing. |
| isInitialized | val isInitialized: Boolean Whether initialize has run. For merchants guarding optional integrations. |
Functions
Section titled “Functions”| Name | Summary |
|---|---|
| initialize | fun initialize(context: Context, config: FrakConfig) Non-blocking, does no I/O, never throws. Second call is a no-op; first config wins. |
| parseReferralLink | fun parseReferralLink(url: String): FrakContext? Pure and static; callable before initialize. Only decodes — does not track arrival. |
| shutdown | suspend fun shutdown() Tears the SDK down: cancels background coroutines, unregisters the deep-link observer, and drops the client so initialize can run again. Not a privacy control — use FrakClient.setTrackingEnabled for that. Idempotent; Java uses shutdownAsync. |
| shutdownAsync | fun shutdownAsync(): CompletableFuture<Void?> shutdown for Java. Runs on its own scope, not the client’s, which shutdown() cancels. Blocking it from the main thread throws rather than deadlocking; sequence a following initialize off the future (thenRun) rather than beside it, or the new client races the old one’s teardown. |