You can use Nami paywalls on-top of your own in-app purchase code or a third-party subscription management solution.
Developer Task
Send this doc to your development team
1. Register for Paywall Buy Sku Callbacks
When an end user wants to make a purchase from a Nami Paywall, register for a callback so your app code can start the purchase flow.
The callback will fire when the user is ready to buy and include the product sku information you need to transaction.
Use this approach if you have your own in-app purchase implementation or use a third-party solution for subscription management.
// Receive a callback when the end user is ready to make a purchase// from a Nami paywall. Implement your purchase code here. by starting the purchase flow.NamiPaywallManager.registerBuySkuHandler { sku inprint("Start the purchase flow for App Store product: \(sku.storeId)")}
// Receive a callback when the end user is ready to make a purchase// from a Nami paywall. Implement your purchase code here.NamiPaywallManager.registerBuySkuHandler { paywall, sku -> Log.d(LOG_TAG, "Start the purchase flow for Google Play/Amazon Appstore product: $skuRefId")}
useEffect(() => {NamiPaywallManager.registerBuySkuHandler((sku) => {// Start your purchase flow console.log('buy sku handler - start purchase flow for sku:',sku.skuId, );}
Once your billing implementation has successfully processed a user's purchase, let the Nami SDK know by calling this method.
Once received, the paywall view will be closed.
// Call this method to tell Nami the purchase, handled by you, was successful and the paywall// should be closed. Additional parameters used to provide a more complete picture for paywall// conversion metrics and analytics.// Pass back the NamiSKU that was passed to you via NamiPurchaseManager.registerBuySkuHandler callback// plus, some artifacts from the purchase from either StoreKit 1 or StoreKit 2// StoreKit 2 Product & Transaction objectsNamiPaywallManager.buySkuComplete(sku: NamiSKU, product: Product, transaction: Transaction)// StoreKit 1 SKProduct & SKPaymentTransaction objectsNamiPaywallManager.buySkuComplete(sku: NamiSKU, product: SKProduct, transaction: SKPaymentTransaction)// or pass in the individual data elements used by Nami, wrapped in a `NamiPurchaseSuccess` objectlet purchaseSuccess = NamiPurchaseSuccess(product: sku, transactionID: transactionId, originalTransactionID: originalTransactionId, originalPurchaseDate: originalPurchaseDate, purchaseDate: purchaseDate, expiresDate: expirationDate, price: price, currencyCode: currency, locale: locale)
NamiPaywallManager.buySkuComplete(purchaseSuccess: purchaseSuccess)
// paywall, and skuRefId were passed to you via NamiPurchaseManager.registerBuySkuHandler// purchase is the purchase object from Google Play BillingNamiPaywallManager.buySkuComplete(paywallActivity, purchase, sku)// or provided a NamiPurchaseSuccess.Google or NamiPurchaseSuccess.Amazon object NamiPaywallManager.buySkuComplete(paywallActivity, purchaseSuccess)