Skip to main content
Supported on: iOS SDK 1.0.70+ · Android SDK 1.0.42+ · React Native SDK 1.0.7+ (New Architecture only)
This is the complete reference for the public methods, types, and delegate interfaces in the @appdna-ai/react-native-sdk package. The React Native SDK delegates rendering, business logic, and storage to the native iOS and Android layers, so every method here resolves to native execution. Every signature on this page is compiled against the package’s published type declarations in CI — if a signature here disagrees with the code you install, the build fails.

Core Methods

All core methods are static on the AppDNA class.

Config Methods

Session Data

Cross-module key-value bag used by Console-configured template interpolation ({{session.*}}).
The location object uses snake_case keys, exactly as the native SDKs store them. Both bridges emit every key on every answer; a value the answer does not have is null: What is filled depends on what the user did. Both platforms and both surfaces — a Location field on a form step and a Location content block — store the same shape. A coordinate that is not a finite number comes back null. A zone the lookup could not find leaves timezone and timezone_offset both null — on every platform and surface; the SDK never makes up a "UTC". Always null-check before using a field.

Experiments

Push (static helpers)

These mirror AppDNA.push.* — use either style.

Presentation

Web Entitlements


Module Namespaces

setDelegate accepts a delegate or null. The parameter is nullable on every module: passing null clears the delegate — its listeners are removed and no callback fires afterward. Registering a new delegate replaces the previous one, so register once at app startup rather than from a component that mounts and unmounts. shutdown() detaches everything.

AppDNA.push

AppDNA.billing

AppDNA.onboarding

AppDNA.paywall

AppDNA.remoteConfig

AppDNA.features

AppDNA.experiments

AppDNA.inAppMessages

AppDNA.surveys

AppDNA.screens

To embed a screen inline in your own React layout instead of presenting it over the app, use <AppDNAScreenSlot>.

AppDNA.lifecycle


Delegate Interfaces

Implement these and register them with the matching module’s setDelegate(...).

AppDNAOnboardingDelegate

AppDNAPaywallDelegate

errorType values

onPaywallPurchaseFailed always carries one of these, so you can decide whether a retry even makes sense without parsing a message:

AppDNAPushDelegate

AppDNABillingDelegate

AppDNAInAppMessageDelegate

AppDNASurveyDelegate

AppDNADeepLinkDelegate

AppDNAScreenDelegate

AppDNALifecycleDelegate


Components

AppDNAScreenSlot

The package’s only React component: it embeds a server-driven screen inline in your layout. See the Screens guide.

Key Types

AppDNAEnvironment

There is no 'staging'. Which backend data you touch is decided by the API-key prefix (adn_test_ for a test key, adn_live_ for a live one); this value only tags the SDK’s own environment. Pass 'sandbox' alongside an adn_test_ key for a test build.

AppDNAOptions

AppDNALogLevel

AppDNABillingProvider

Adapty is the one provider with an associated value. A keyless Adapty is refused natively — both platforms fall back to the platform store rather than run without a key — so the type makes it impossible to write:

StepAdvanceResult

The plain object you return from onBeforeStepAdvance. The hook’s TypeScript return type is Promise<Record<string, unknown>> — native decodes the type discriminator:
An unrecognised type is not an error: native falls back to proceed and the user advances. On a sign-in action it blocks instead (“Sign-in isn’t available right now. Please try again later.”). Get the string right.

StepConfigOverride

The plain object you return from onBeforeStepRender (or null to render the step unchanged):

PaywallContext

PaywallAction

The action string passed to onPaywallAction:

PushPayload

The notification map, with the keys native actually sends — snake_case:

PushAction

One structured notification action button. id echoes back as onPushTapped’s actionId.

Entitlement

The union of what the two platforms know. A key that the running platform has no concept of is omitted, never faked — so the platform-specific fields are optional, and an absent one means “this platform does not know”, not false or "". Ask isActive. It is the cross-platform question: both platforms send it, and on Android it is derived from the Play status so you never have to learn that vocabulary.

TransactionInfo

What a successful purchase(...) resolves with. There is no status field: a resolved promise is the purchase. A cancellation, a pending (deferred / ask-to-buy) purchase, and a store error all reject — catch them, do not test a status.

ProductInfo

Platform-specific keys are omitted, never faked: an absent key means the platform has no concept of it.
There is no numeric price field. iOS’s native price is a Decimal, which cannot cross the bridge without loss, so both platforms send integer priceMicros. Render displayPrice (already localized and currency-formatted), or divide priceMicros by 1,000,000 when you need the number.

WebEntitlement


Notes

Architecture

The React Native package exposes API facades, DTOs, and bridge calls; rendering, business logic, network I/O, and storage execute in the native iOS (Swift) and Android (Kotlin) SDKs. The delegate interfaces and the native module spec are generated from the same source as the iOS and Android surfaces, so the TypeScript API cannot silently drift from them.

Platform-specific behavior

  • billingProvider applies on both platforms ('storeKit2' = StoreKit 2 on iOS, Google Play Billing on Android). Under 'revenueCat', Adapty or 'none' the SDK never buys, restores, finishes or acknowledges; purchase and restore reject with providerNotAvailable.
  • requestPermission() on AppDNA.push triggers the iOS APNs prompt or the Android 13+ POST_NOTIFICATIONS runtime permission.
  • shutdown() flushes queued events and releases native resources on both platforms, and the wrapper additionally detaches every delegate, veto handler, and cached snapshot.
  • offerToken on purchase(...) selects an Android base-plan offer and is ignored on iOS.
  • onBillingUnavailable fires on Android only.
  • notificationIcon applies on Android only.