Supported on: iOS SDK
1.0.61+ · Android SDK 1.0.33+ · React Native SDK 1.0.4+identify(), the SDK listens for entitlement changes automatically — when a user purchases on the web, the app unlocks instantly without a restart.
How It Works
- User purchases a subscription on your website (via Stripe or another web payment provider).
- Your backend writes the entitlement to AppDNA.
- The SDK detects the change in real-time and updates the local cache.
- Your app reacts via the subscription callback and unlocks premium features.
Web entitlements are separate from in-app purchase entitlements (StoreKit on iOS, Play Billing on Android). They are designed for apps that also sell subscriptions through a web checkout flow.
Check Current Entitlement
Afteridentify(), the current web entitlement is available via an async getter on AppDNA. The native SDK returns the cached value immediately when available:
Listen for Changes
AppDNA.onWebEntitlementChanged is backed by a native event on NativeEventEmitter. Subscribe to react in real-time when the entitlement status changes:
- A new web subscription is purchased
- A subscription renews
- A subscription expires or is canceled
- A subscription enters a grace period
WebEntitlement
| Property | Type | Description | |
|---|---|---|---|
isActive | boolean | Whether the subscription is currently active | |
planName | `string | null` | Name of the subscription plan |
priceId | `string | null` | Stripe price identifier |
status | string | Current status (see below) | |
currentPeriodEnd | `string | null` | End of the current billing period (ISO 8601) |
interval | `string | null` | Billing interval (e.g., "month", "year") |
trialEnd | `string | null` | Trial expiration date (ISO 8601), if in a trial |
Entitlement Statuses
| Status | Description |
|---|---|
active | Subscription is active and paid |
trialing | User is in a free trial period |
past_due | Payment failed, in grace period |
canceled | Subscription is canceled (access may continue until period ends) |
Access
Web entitlements are accessed as top-level members onAppDNA:
Auto-Tracked Events
| Event | Trigger |
|---|---|
web_entitlement_activated | Web subscription becomes active |
web_entitlement_expired | Web subscription expires or is canceled |
Full Example
Web entitlements require Stripe (or compatible payment provider) integration configured in the Console under Settings > Billing > Web Payments. The real-time listener activates automatically after
identify() is called.
