Configure at application startup
Kotlin/Flutter 0.2.1 configure takes a public key and optional customer ID; guest, authenticated and Web startup examples.
Configure once from the application's session owner during startup. Disable purchases until it succeeds. Do not repeat configure in widget builds, Composable bodies, or every screen opening.
Mobile inputs
| Input | Requirement | Meaning |
|---|---|---|
apiKey | Required | Public Inappify app key, not a secret REST key |
appUserIdentifier | Optional; null by default | Stable account ID authenticated by your application |
The SDK reads host version metadata; the server resolves store and RSA from the app. market, marketKey, country, appVersion, forceVersion and protocol selectors are not public mobile configure inputs. Save the store RSA in dashboard app settings.
Flutter: guest or existing account
These are alternatives, not two calls on every startup:
Before operations in main, call WidgetsFlutterBinding.ensureInitialized(). Convenience configure(...) returns bool; configureResult(...) preserves failure and snapshot. Use startup UI and explicit retry state if network/account recovery takes time.
Kotlin: optional identity
Omit customerId for guest/retained startup; provide a stable known ID for an authenticated account. Inspect InappifyResult.Success/Failure. Client creation is separate from configure; do not create a new client for each account transition.
Omitted identity is not logout
The SDK may reuse a saved identity, including a signed-in account. It creates Anonymous only when appropriate without a retained session. Do not manufacture an anonymous prefix or generate a new customer every launch. Use logIn and logOut for transitions.
Prefetch and recovery
The SDK owns offering prefetch and startup recovery. Do not warm offerings with getOfferings in Android Application.onCreate. Configure success does not mean every recovery operation finished; follow the relevant purchase result or later snapshot.
Web has a separate contract
JavaScript InAppify.configure({apiKey, country?, appVersion?, ...}) returns a client; appVersion is the host version. Use a Public Web App Key. Flutter Web also needs the JS provider first. A client-supplied ID is not Web authentication; use Identity Tickets or OTP.
Flutter's configureAuthenticatedWebSessionResult has Web-specific ticket-provider, expected-identity and appVersion inputs. Do not add those to mobile configure.