github bizz84/SwiftyStoreKit 0.9.1
Expose SKProduct in PurchaseDetails type returned by PurchaseResult

latest releases: 0.16.4, 0.16.3, 0.16.2...
6 years ago

This is a minor release which includes a fix for #185 (addressed in #206). Summary:

When a purchase succeeds, it is desirable to get access to the purchased SKProduct in the completion block, so that it's possible to query the price and other properties.

With this change, this is now possible:

SwiftyStoreKit.purchaseProduct("productId", atomically: true) { result in
    if case .success(let purchase) = result {
        // Deliver content from server, then:
        if purchase.needsFinishTransaction {
            SwiftyStoreKit.finishTransaction(purchase.transaction)
        }
        print("Purchased product with price: \(purchase.product.price)")
    }
}

Don't miss a new SwiftyStoreKit release

NewReleases is sending notifications on new releases.