RevenueCat / purchases-ios

In-app purchases and subscriptions made easy. Support for iOS, watchOS, tvOS, macOS, and visionOS.
https://www.revenuecat.com/
MIT License
2.22k stars 295 forks source link

Paywalls manually handle purchases, finishTransactions/ObserverMode -> PurchasesAreCompletedBy #3917

Open joshdholtz opened 1 month ago

joshdholtz commented 1 month ago

Motivation

Todo

Description

Adds new . handlePurchaseAndRestore modifier that can be used to complete purchases initiated via a paywall:

.handlePurchaseAndRestore(
    performPurchase: { storeProduct, purchaseResultReporter in
        // make purchase for `storeProduct`

        // report result to RevenueCat
        purchaseResultReporter.reportResult(userCancelled: false, error: nil)
    }, performRestore: { restoreResultReporter in
        // restore purchases

        // report result to RevenueCat
        restoreResultReporter.reportResult(success: true, error: nil)
    })
RevenueCat-Danger-Bot commented 1 month ago
1 Message
:book: Size increase: 22.06 KB

Generated by :no_entry_sign: Danger