InappifySdk class

Flutter façade for the Inappify SDK.

Static operations share one session-owning backend. Android requires the native Kotlin SDK through MethodChannel; iOS uses the Dart V2 client with native metadata and Keychain storage. Web requires the host-loaded Inappify JavaScript SDK. Synchronous getters mirror the latest backend snapshot.

Constructors

InappifySdk()
Creates a compatibility handle.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

accessToekn ↔ String?
Legacy spelling retained for source compatibility.
getter/setter pair
apiKeyValue ↔ String?
API key mirrored from the active backend.
getter/setter pair
appId → int?
Application identifier assigned by Inappify, when configured.
no setter
country → String
Country code mirrored from the selected backend.
no setter
customerInfo ↔ CustomerInfo?
Latest customer snapshot returned by the active backend.
getter/setter pair
events → Stream<InappifyPlatformEvent>
Ordered asynchronous updates emitted by the selected SDK backend.
no setter
faildToLoadCustomerInfo → bool
Whether the latest customer-information refresh failed.
no setter
faildToLoadOfferings → bool
Whether the latest offering refresh failed.
no setter
httpTraces → Stream<InappifyHttpTrace>
Filtered mobile HTTP diagnostics, active only while listened to.
no setter
lastFailure → InappifyFailure?
Most recent semantic failure observed through this compatibility façade.
no setter
offerings ↔ OfferingsModel?
Latest offering snapshot returned by the active backend.
getter/setter pair
purchaseUpdates → Stream<InappifyPurchaseAttempt>
Live Android purchase/recovery outcomes. Query history after configure for missed events.
no setter
sdkVersion → String?
Version of the backend SDK that owns the active session.
no setter
sessionPersistenceMode → InappifySessionPersistenceMode
Whether the backend reports durable or memory-only session persistence.
no setter
sessionState → InappifySessionState
Token-free lifecycle state of the backend-owned session.
no setter
sessionStateChanges → Stream<InappifySessionStateChange>
Typed, token-free Web session lifecycle updates.
no setter
snapshot → InappifySdkSnapshot
Last mirrored backend state. Use typed operations for authoritative checks.
no setter
storeInfo ↔ String?
Store metadata returned during configuration, when available.
getter/setter pair
vCode → int?
Host application version code mirrored from the selected backend.
no setter
vName → String
Host application version name mirrored from the selected backend.
no setter

Static Methods

canSetReservedAttribute(String key) → Future<bool>
Checks whether a reserved key can be written.
canSetReservedAttributeResult(String key) → Future<InappifySdkResult<bool>>
Typed reserved-attribute capability result.
configure({required String apiKey, String? appUserIdentifier}) → Future<bool>
Configure with the app key and optional customer identifier. Native metadata and the server supply app version, market and billing key.
configureAuthenticatedWebSession({required String apiKey, required InappifyIdentityTicketProvider identityTicketProvider, String? expectedCustomerIdentifier, String? country, String? appVersion, InappifyRequestCancellation? cancellation}) → Future<bool>
Configures and guarantees an authenticated Web session for a logged-in host application user.
configureAuthenticatedWebSessionResult({required String apiKey, required InappifyIdentityTicketProvider identityTicketProvider, String? expectedCustomerIdentifier, String? country, String? appVersion, InappifyRequestCancellation? cancellation}) → Future<InappifySdkResult<void>>
Typed variant of configureAuthenticatedWebSession.
configureResult({required String apiKey, String? appUserIdentifier}) → Future<InappifySdkResult<void>>
confirmDelivery(int deliveryId) → Future<InappifySdkResult<PurchaseResult>>
Call ONLY after durably granting this delivery once for the same app/user. A failed acknowledgement must not cause a second inventory grant.
createCheckout({required String productIdentifier, required String offeringIdentifier, required String packageIdentifier, String? discountCode, String? country, String? appVersion, String? idempotencyKey, bool isCrypto = false, InappifyRequestCancellation? cancellation}) → Future<InappifySdkResult<InappifyCheckoutResult>>
Creates a canonical checkout without navigating the browser.
createOtpCaptcha({InappifyRequestCancellation? cancellation}) → Future<InappifyCaptchaChallenge?>
Creates a CAPTCHA challenge for an OTP flow that requires one.
createOtpCaptchaResult({InappifyRequestCancellation? cancellation}) → Future<InappifySdkResult<InappifyCaptchaChallenge>>
Typed CAPTCHA challenge result.
customerInfoWithPolicy(InappifyFetchPolicy policy) → Future<InappifySdkResult<CustomerInfo>>
exchangeIdentityTicket({required String identityTicket, InappifyRequestCancellation? cancellation}) → Future<InappifyAuthenticationResult?>
Exchanges a backend-issued, single-use Identity Ticket.
exchangeIdentityTicketResult({required String identityTicket, InappifyRequestCancellation? cancellation}) → Future<InappifySdkResult<InappifyAuthenticationResult>>
Typed Identity Ticket exchange result with non-secret diagnostics.
getCheckoutStatus({required String checkoutId, InappifyRequestCancellation? cancellation}) → Future<InappifySdkResult<InappifyCheckoutResult>>
Reads one authoritative checkout state without polling.
getConfiguration() → Future<InappifyConfiguration?>
Returns token-free backend capabilities and browser allowlists.
getConfigurationResult() → Future<InappifySdkResult<InappifyConfiguration>>
Typed, token-free configuration query.
getCurrentOffering({String? placementIdentifier}) → Future<OfferingModel?>
Placement selection, then current offering, then project default.
getCurrentOfferingResult({String? placementIdentifier}) → Future<InappifySdkResult<OfferingModel>>
getCustomerInfo({InappifyCacheFetchPolicy fetchPolicy = InappifyCacheFetchPolicy.cachedOrFetched}) → Future<CustomerInfo?>
Default: return cached data, then refresh stale data in the background.
getCustomerInfoResult({InappifyCacheFetchPolicy fetchPolicy = InappifyCacheFetchPolicy.cachedOrFetched}) → Future<InappifySdkResult<CustomerInfo>>
Validates a discount code for the active customer. Web uses offeringIdentifier when supplied, otherwise its current offering. Android and iOS retain their code-only payment-link behavior.
getDiscountedPaymentLinksResult(String discountCode, {String? offeringIdentifier}) → Future<InappifySdkResult<ValidateDiscountCodeData>>
getEntitlement(String identifier) → EntitlementModel?
Returns the named entitlement from the latest customer snapshot.
getOffering(String identifier) → Future<OfferingModel?>
getOfferingResult(String identifier) → Future<InappifySdkResult<OfferingModel>>
getOfferings() → Future<OfferingsModel?>
Read offerings through the native cache and automatic refresh policy.
getOfferingsResult() → Future<InappifySdkResult<OfferingsModel>>
getPendingCheckoutId() → Future<String?>
Returns the non-secret checkout id retained across a browser redirect.
getPendingCheckoutIdResult() → Future<InappifySdkResult<String>>
Typed pending-checkout query result.
getPurchaseAttempt(String attemptId) → Future<InappifySdkResult<InappifyPurchaseAttempt>>
Reads encrypted native history. Successful null data means unknown, never failed.
getPurchaseAttempts() → Future<InappifySdkResult<List<InappifyPurchaseAttempt>>>
Only marked InAppify payment-return links trigger native recovery.
handlePaymentReturn({String? checkoutId, int timeoutMs = 60000, int intervalMs = 1500, InappifyRequestCancellation? cancellation}) → Future<InappifyCheckoutResult?>
Polls authoritative checkout state after returning from a payment page.
handlePaymentReturnResult({String? checkoutId, int timeoutMs = 60000, int intervalMs = 1500, InappifyRequestCancellation? cancellation}) → Future<InappifySdkResult<InappifyCheckoutResult>>
Typed authoritative checkout polling result.
hasEntitlement(String identifier) → bool
Alias for isActiveEntitlement matching the Web SDK terminology.
isActiveEntitlement(String name) → bool
Returns whether the named entitlement is active in the mirrored snapshot.
isCustomerAnonymous({required String? appUserIdentifier}) → bool
isPaymentUrlAllowed(String url) → Future<InappifySdkResult<bool>>
logIn(String appUserIdentifier) → Future<bool>
Changes the active Inappify customer identity. Login uses the configured session; no app key is required again.
logInResult(String appUserIdentifier) → Future<InappifySdkResult<void>>
Typed variant of logIn. Web callers should use Identity Ticket or OTP.
loginWithIdentityTicket({required String identityTicket, InappifyRequestCancellation? cancellation}) → Future<InappifyAuthenticationResult?>
Alias for exchangeIdentityTicket.
loginWithIdentityTicketResult({required String identityTicket, InappifyRequestCancellation? cancellation}) → Future<InappifySdkResult<InappifyAuthenticationResult>>
Typed alias for exchangeIdentityTicketResult.
logOut() → Future<bool>
End the session through the existing native identity/cache transition.
logOutResult() → Future<InappifySdkResult<void>>
offeringsWithPolicy(InappifyFetchPolicy policy) → Future<InappifySdkResult<OfferingsModel>>
purchase(InappifyPurchaseParams params) → Future<PurchaseResult?>
Purchase a package returned by an offering; Android supplies its Activity.
purchaseResult(InappifyPurchaseParams params) → Future<InappifySdkResult<PurchaseResult>>
Typed result retains the attempt key for retrying the same logical purchase.
requestOtp({required String phone, String? captchaKey, String? captchaAnswer, InappifyRequestCancellation? cancellation}) → Future<InappifyOtpChallenge?>
Requests an OTP challenge for the supplied phone number.
requestOtpResult({required String phone, String? captchaKey, String? captchaAnswer, InappifyRequestCancellation? cancellation}) → Future<InappifySdkResult<InappifyOtpChallenge>>
Typed OTP challenge request with non-secret diagnostics.
restoreStorePurchases() → Future<InappifySdkResult<InappifyRestoreResult>>
Restores eligible store purchases after an explicit user action.
setApnsToken(String apnsToken) → Future<bool>
Stores the reserved APNs device token attribute.
setAttributes(Map<String, String?> attributes) → Future<bool>
Stores or removes custom customer attributes. Null or empty values delete a key through the durable attribute queue.
setAttributesResult(Map<String, String?> attributes) → Future<InappifySdkResult<List<Attribute>>>
setCampaign(String campaign) → Future<bool>
Stores the reserved acquisition campaign attribute.
setConsumableDeliveryHandler(InappifyConsumableDeliveryHandler? handler) → Future<InappifySdkResult<void>>
Register before configure; return delivered only after a durable, idempotent grant. Pass null to remove the handler. Never call confirmDelivery from the handler.
setDisplayName(String displayName) → Future<bool>
Stores the reserved customer display-name attribute.
setEmail(String email) → Future<bool>
setFcmToken(String fcmToken) → Future<bool>
Stores the reserved FCM token attribute.
setIdfa(String idfa) → Future<bool>
Stores the reserved Apple advertising identifier attribute.
setIdfv(String idfv) → Future<bool>
Stores the reserved Apple vendor identifier attribute.
setIp(String ip) → Future<bool>
Stores the reserved customer IP attribute.
setKeyword(String keyword) → Future<bool>
Stores the reserved acquisition keyword attribute.
setLogHandler(InappifyLogHandler? handler) → Future<void>
Replaces console output with filtered SDK messages; null restores the console.
setLogLevel(InappifyLogLevel level) → Future<void>
Global minimum severity, configurable before Configure. Defaults to debug in development and info in release/profile builds.
setNetworkEnabled(bool enabled) → Future<InappifySdkResult<void>>
setPhoneNumber(String phoneNumber) → Future<bool>
Stores the reserved customer phone-number attribute.
setReservedAttributeResult({required InappifyReservedAttribute attribute, required String value, InappifyRequestCancellation? cancellation}) → Future<InappifySdkResult<void>>
Typed reserved-attribute update result.
syncAttributesAndOfferingsIfNeeded() → Future<InappifySdkResult<OfferingsModel>>
Flush attributes and fetch offerings; native limit: five calls per minute.
syncPendingConsumables() → Future<InappifySdkResult<InappifyConsumableSyncResult>>
Returns server-authoritative deliveries. Does not grant host inventory.
syncStorePurchases() → Future<InappifySdkResult<List<PurchaseResult>>>
Manually checks owned store purchases and interrupted purchase operations. Normal startup and foreground recovery are already handled internally on Android.
verifyOtp({required String challengeId, required String code, InappifyRequestCancellation? cancellation}) → Future<InappifyAuthenticationResult?>
Verifies an OTP challenge and replaces the active session on success.
verifyOtpResult({required String challengeId, required String code, InappifyRequestCancellation? cancellation}) → Future<InappifySdkResult<InappifyAuthenticationResult>>
Typed OTP verification result with non-secret diagnostics.