billdog_superwall 1.1.2-beta.5
billdog_superwall: ^1.1.2-beta.5 copied to clipboard
Optional bridge between Superwall paywalls and BillDog purchases for Flutter. Superwall presents; BillDog buys, restores and owns entitlements.
billdog_superwall #
The bridge between Superwall paywalls and BillDog purchases for Flutter: Superwall presents the paywall, BillDog buys, restores and owns the entitlements.
SuperwallBillDogPurchaseController is a Superwall PurchaseController backed by
billdog_flutter. Every purchase and restore a Superwall paywall starts goes through BillDog,
and BillDog's customer info drives Superwall's subscription status. billdog_flutter itself
does not depend on Superwall; add this package only if you use Superwall.
Install #
dependencies:
billdog_flutter: 1.1.2-beta.5
billdog_superwall: 1.1.2-beta.5
superwallkit_flutter: ^2.6.0 # verified against 2.6.0 and 2.8.0
Use the same version for billdog_flutter and billdog_superwall.
Use #
import 'package:billdog_flutter/billdog_flutter.dart';
import 'package:billdog_superwall/billdog_superwall.dart';
import 'package:superwallkit_flutter/superwallkit_flutter.dart' as sw;
await BillDog.configure('bd_public_...');
final controller = SuperwallBillDogPurchaseController(
// BillDog entitlement id -> the Superwall entitlement it is reported as (unmapped ids pass through).
entitlementMap: {'pro': 'premium'},
// Superwall paywall id -> the BillDog offering behind it, so purchases are credited to it.
offeringMap: {'onboarding_paywall': 'default'},
);
sw.Superwall.configure('pk_...', purchaseController: controller);
controller.startSyncingSubscriptionStatus();
- With
syncIdentity(on by default) Superwall's user is identified as BillDog's app user id; an anonymous BillDog id is never sent. - On Android the bridge buys the base plan and offer the Superwall paywall selected.
- Forward
SuperwallDelegate.handleCustomPaywallAction(name)tocontroller.handleCustomPaywallAction(name)to start BillDog web checkout from abilldog_web_checkout:<productId>paywall action, and the app's incoming links tocontroller.handleDeepLink(uri).
Full guide: billdog.io/docs/superwall-integration.