FrakClient
Ce contenu n’est pas encore disponible dans votre langue.
class FrakClient
Everything the SDK can do. Obtained from Frak.client. Every suspending member has a *Async twin returning a CompletableFuture, since a Java caller cannot name a Continuation.
How failure is signalled, one tier per kind of answer:
T?means absence — nothing was there, and that is a normal answer (anonymousId, RewardsApi.best, SharingApi.buildLink’s null arm).- A sealed or enum type means outcome — several ends are all valid (OpenAppResult).
Booleanmeans predicate (AppLinkApi.isFrakAppInstalled).- A thrown id.frak.sdk.core.FrakError means failure — the call could have worked and did not (ConfigApi.resolve, RewardsApi.campaigns, SharingApi.buildLink, AppLinkApi.installPageUrl). Through an
*Asynctwin this arrives as aCompletionExceptionwhosecauseis the id.frak.sdk.core.FrakError.
TrackingApi is the one deliberate exception: it returns id.frak.sdk.core.FrakResult and never throws, because it is called from hot paths where a disabled-tracking refusal is expected rather than exceptional. A tier change is invisible to the ABI dump, so it needs a ! commit.
Properties
Section titled “Properties”| Name | Summary |
|---|---|
| appLink | val appLink: AppLinkApi Inbound referral links and the wallet app handoff. |
| config | val config: ConfigApi Config resolution and its live stream. |
| environment | val environment: FrakEnvironment The stage this client talks to. Merchants never set it directly, see id.frak.sdk.core.FrakConfig.env. |
| metadataLang | val metadataLang: FrakLanguage? The merchant-supplied build-time language, for the same tier-3 copy. See metadataName. |
| metadataName | val metadataName: String? The merchant-supplied build-time name. public only so :frak-sdk-ui can read it across the module boundary. |
| rewards | val rewards: RewardsApi Campaigns and the single best reward to advertise. |
| sharing | val sharing: SharingApi Share link construction. |
| tracking | val tracking: TrackingApi Interaction and purchase tracking. |
Functions
Section titled “Functions”| Name | Summary |
|---|---|
| anonymousId | suspend fun anonymousId(): String? Anonymous id, or null when tracking is disabled or the device refused key material. |
| anonymousIdAsync | fun anonymousIdAsync(): CompletableFuture<String?> anonymousId for Java. |
| isTrackingEnabled | suspend fun isTrackingEnabled(): Boolean Whether tracking is currently allowed: FrakConfig.trackingEnabled AND the persisted runtime decision. |
| isTrackingEnabledAsync | fun isTrackingEnabledAsync(): CompletableFuture<Boolean> isTrackingEnabled for Java. |
| resetAnonymousId | suspend fun resetAnonymousId(): Boolean Destroys the keypair so the next anonymousId mints a new identity. |
| resetAnonymousIdAsync | fun resetAnonymousIdAsync(): CompletableFuture<Boolean> resetAnonymousId for Java. |
| setTrackingEnabled | suspend fun setTrackingEnabled(enabled: Boolean) Turns tracking on or off at runtime and persists the decision for this install. false purges anything still queued, which can discard purchase events not yet sent; true cannot lift a build shipping trackingEnabled(false). Identity survives — see resetAnonymousId. |
| setTrackingEnabledAsync | fun setTrackingEnabledAsync(enabled: Boolean): CompletableFuture<Void?> setTrackingEnabled for Java. |