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

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)")
    }
}
latest releases: 0.16.3, 0.16.2, 0.16.1...
4 years ago