Methods, parameters and defaults
Quick reference for Kotlin, Flutter and JavaScript signatures, required/optional inputs, defaults and platform support.
Baseline: Kotlin/Flutter 0.2.1, JavaScript 0.2.0. These tables select public APIs; consult backend support first. Examples are alternatives, not a startup script executing every operation.
Sessions
| Kotlin | Flutter | Inputs and output |
|---|---|---|
configure(InappifyOptions(apiKey)) | configure(apiKey: key) / configureResult(...) | Required public key; optional customer ID defaults null; Kotlin Result, Flutter convenience bool |
configure(InappifyOptions(apiKey, userId)) | configure(apiKey: key, appUserIdentifier: id) | Existing authenticated account; no market/version context input |
logIn(id) | logIn(id) / logInResult(id) | One ID string, mobile |
logOut() | logOut() / logOutResult() | No inputs |
isCustomerAnonymous(identifier) | isCustomerAnonymous(appUserIdentifier: identifier) | String helper, not session authority |
JavaScript InAppify.configure(options) returns a client; client.logIn({identityTicket}) or ({challengeId, code}) authenticates; client.logOut() signs out. Flutter Web uses authenticated startup, ticket exchange or OTP.
Offerings
| Intent | Kotlin | Flutter | JavaScript |
|---|---|---|---|
| Collection | getOfferings() | getOfferings() / getOfferingsResult() | getOfferings() |
| Current | getCurrentOffering() | getCurrentOffering() / getCurrentOfferingResult() | getCurrentOffering() |
| Placement | getCurrentOffering("upgrade") | getCurrentOffering(placementIdentifier: 'upgrade') and Result | getCurrentOffering('upgrade') |
| Exact ID | getOffering("special_offer") | getOffering('special_offer') and Result | getOffering('special_offer') |
| Manual refresh | syncAttributesAndOfferingsIfNeeded() | Same name, already Result | Same name, Promise |
Placement defaults null; mobile has no forceRefresh. Flutter Web does not implement combined sync. Collection helpers current, getOffering(id), getCurrentOfferingForPlacement(id) are network-free. Mobile all is a map; JS all is an array.
CustomerInfo
Mobile client.getCustomerInfo() and InappifySdk.getCustomerInfo() default to cachedOrFetched. Flutter Result takes the same optional fetchPolicy:.
| Mode | Kotlin | Flutter | JS |
|---|---|---|---|
| Cached or fetched | InappifyCacheFetchPolicy.CACHED_OR_FETCHED | InappifyCacheFetchPolicy.cachedOrFetched | CacheFetchPolicy.CACHED_OR_FETCHED |
| Cache only | CACHE_ONLY | cacheOnly | CACHE_ONLY |
| Server | FETCH_CURRENT | fetchCurrent | FETCH_CURRENT; Web default |
| Fresh cache or server | NOT_STALE_CACHED_OR_CURRENT | notStaleCachedOrCurrent | NOT_STALE_CACHED_OR_CURRENT |
Flutter Web doesn't forward the policy. hasEntitlement(id), isActiveEntitlement(id), getEntitlement(id) are synchronous. Mobile has entitlement active/all maps; JS entitlements are an array.
Attributes and discounts
| Method | Parameters/defaults |
|---|---|
Kotlin setAttributes(map) / Flutter setAttributes(map) and Result / JS setAttributes(object) | String keys, String/null values; null/empty deletes |
setEmail, setDisplayName, setPhoneNumber, setApnsToken, setFcmToken, setIdfa, setIdfv, setCampaign, setKeyword | One String; check write/platform support |
Kotlin/Flutter setIp(value) | One String; current iOS rejects, Web has no helper |
canSetReservedAttribute(key) | Exact key such as $email; Flutter has a Result variant |
Kotlin setReservedAttribute(request) | InappifyReservedAttributeRequest(attribute, value) |
Flutter setReservedAttributeResult(attribute:, value:) | Required enum/String; empty value deletes |
Kotlin getDiscountedPaymentLinks(code) | Code only; Result of payment links |
Flutter getDiscountedPaymentLinks(code, offeringIdentifier: id) and Result | Optional null identifier; only Web uses it to select |
JS validateDiscountCode(code) / (code, offeringId) | Current or explicit selection; Promise of priced offering |
Purchases, history and delivery
| Method | Input and limits |
|---|---|
Kotlin purchase(InappifyPurchaseParams.Builder(activity, package).build()) | Activity for new store UI; Builder(package) for Direct |
Flutter purchase(InappifyPurchaseParams(packageToPurchase: package)) and Result | Required Package; key/paywallId/paywallRevision null; bridge supplies Activity |
JS purchase({package}, {redirect: false}) | Required Package; optional key/code/context; redirect defaults true |
Kotlin/Flutter getPurchaseAttempt(id), getPurchaseAttempts() | Android only here; null lookup is unknown |
Flutter purchaseUpdates / Kotlin addEventListener | Correlated Android result; release observer with owner |
syncStorePurchases() | No input; manual Android, Direct-only iOS |
restoreStorePurchases() | No input; explicit Android restore; no iOS StoreKit |
setConsumableDeliveryHandler(handler) | Android/direct JS; callback delivered or retryLater |
syncPendingConsumables() | Native/direct JS, unavailable in Flutter Web |
confirmDelivery(deliveryId) | After commit; Kotlin Long, Flutter int, JS number |
handleDeepLink(url) | Native Android recognized payment returns only |
Price classification/context come from the Package. Optional paywall fields must be paired. Don't replay uncertain payment with a new key. Purchase and delivery invariants are part of this contract.
Flutter Web-only methods
| Method | Inputs |
|---|---|
configureAuthenticatedWebSessionResult and bool variant | Required apiKey/identityTicketProvider; optional expectedCustomerIdentifier/country/appVersion/cancellation |
loginWithIdentityTicketResult or exchangeIdentityTicketResult and nullable variants | Required identityTicket, optional cancellation; use one exchange per ticket |
createOtpCaptchaResult() and nullable variant | Optional cancellation |
requestOtpResult(phone:, captchaKey:, captchaAnswer:) and nullable variant | Required phone; optional CAPTCHA/cancellation |
verifyOtpResult(challengeId:, code:) and nullable variant | Two required strings, optional cancellation |
createCheckout(...) | Required product/offering/package IDs; discountCode/country/appVersion/key/cancellation null; legacy Web isCrypto=false |
getCheckoutStatus(checkoutId:) | Required ID, optional cancellation; one query |
getPendingCheckoutIdResult() and nullable variant | No inputs |
handlePaymentReturnResult(...) and nullable variant | checkoutId null → pending; timeoutMs=60000, intervalMs=1500, optional cancellation |
Here isCrypto is a legacy Web checkout option, not mobile purchase input. Copy safe requests from the Web guide.
Advanced mobile controls and observations
Kotlin customerInfo(policy)/offerings(policy) and Flutter customerInfoWithPolicy(policy)/offeringsWithPolicy(policy) take a distinct cacheOnly/cacheFirst/networkFirst/networkOnly enum. Don't conflate it with four semantic CustomerInfo policies. setNetworkEnabled(bool) gates mobile HTTP without deleting paid work. isPaymentUrlAllowed(url) checks Direct destinations. These controls are unsupported on Flutter Web.
Flutter getConfiguration()/getConfigurationResult(), snapshot, events and sessionStateChanges expose observations; do not rewrite ownership with legacy mutable setters. Close Kotlin listener registrations and collect stateUpdates() within UI lifetime.