bizz84/SwiftyStoreKit
Lightweight In App Purchases Swift framework for iOS 8.0+, tvOS 9.0+ and macOS 10.10+ ⛺
📋 What's Changed
- Fix watch build on xcode 12.5 by @fnuky in https://github.com/bizz84/SwiftyStoreKit/pull/645
- Add "SwiftyStoreKit to RevenueCat Migration Guide" to README by @bizz84 in https://github.com/bizz84/SwiftyStoreKit/pull/649
- Add link to Glassfy to README by @bizz84 in https://github.com/bizz84/SwiftyStoreKit/pull/654
- Add "is_upgraded" properties for ReceiptItem by @ManyLattice in https://github.com/bizz84/SwiftyStoreKit/pull/656
- Add app that uses SwiftyStoreKit by @jamestapping in https://github.com/bizz84/SwiftyStoreKit/pull/650
- Communicate deferred transactions to the app by @azouts in https://github.com/bizz84/SwiftyStoreKit/pull/652
- Added Written Tutorial section / Added Tutorial by @jamestapping in https://github.com/bizz84/SwiftyStoreKit/pull/651
✨ New Contributors
- @fnuky made their first contribution in https://github.com/bizz84/SwiftyStoreKit/pull/645
- @ManyLattice made their first contribution in https://github.com/bizz84/SwiftyStoreKit/pull/656
- @jamestapping made their first contribution in https://github.com/bizz84/SwiftyStoreKit/pull/650
- @azouts made their first contribution in https://github.com/bizz84/SwiftyStoreKit/pull/652
- Full Changelog: https://github.com/bizz84/SwiftyStoreKit/compare/0.16.3...0.16.4
Fixed issues when compiling for watchOS, with SPM, Xcode 12, and / or Swift 5.3+.
✨ New Features
- watchOS support. Apple has introduced in-app purchases on the Apple Watch starting with watchOS 6.2. Now you can use SwiftyStoreKit to take advantage of this additional platform.
- Discount support. Now your app can offer in-app purchase discounts to users through SwiftyStoreKit (#458).
- Cancellable requests. Attempt to cancel requests sent with SwiftyStoreKit.
🐛 Improvements & Bug Fixes
- Sandbox purchasing process should be improved. New checks exist to help you identify when a request is being sent in the sandbox and to isolate sandbox-specific errors.
- Added `Purchased` protocol to create common conformance for `Purchase`, `PurchaseDetails`, and `ReceiptItem`.
- Fixed callback issues when restoring items.
- Added a new API to retrieve all product identifiers, `getDistinctPurchaseIds`.
- Extended support for your own receipt verification process.
- `ReceiptItem` now conforms to `Codable`.
- Additional extensions on existing `StoreKit` classes for `localizedSubscriptionPeriod`, `localizedPrice`, and `localizedDiscountPrice`.
📋 Changes
- The project should now correctly compile for macOS Catalyst
📋 Changes
- Update project to Swift 5 ([#457](https://github.com/bizz84/SwiftyStoreKit/pull/457)), related issue: [#456](https://github.com/bizz84/SwiftyStoreKit/issues/456)
- Add basic SwiftPM manifest file ([#460](https://github.com/bizz84/SwiftyStoreKit/pull/460))
📋 Changes
- Add missing `else` condition in `SwiftyStoreKit.purchaseProduct` ([#426](https://github.com/bizz84/SwiftyStoreKit/pull/426))
📋 Changes
- Added new property `isInIntroOfferPeriod` to ReceiptItem ([#404](https://github.com/bizz84/SwiftyStoreKit/pull/404), [#409](https://github.com/bizz84/SwiftyStoreKit/pull/409))
- Add Swift 4.2 Support ([#408](https://github.com/bizz84/SwiftyStoreKit/pull/408)), update project to Xcode 10 ([#410](https://github.com/bizz84/SwiftyStoreKit/pull/410))
📋 Changes
- Fix macOS compile error on Xcode 10.0 beta (10L176w) ([#381](https://github.com/bizz84/SwiftyStoreKit/pull/381), see [#380](https://github.com/bizz84/SwiftyStoreKit/issues/380))
📋 Changes
- Swift 4.1 / Xcode 9.3 Support ([#360](https://github.com/bizz84/SwiftyStoreKit/pull/360))
📋 Changes
- Add a wrapper for `simulatesAskToBuyInSandbox` ([#349](https://github.com/bizz84/SwiftyStoreKit/pull/349))
📋 Changes
- Add support for downloading content hosted with Apple ([#343](https://github.com/bizz84/SwiftyStoreKit/pull/343), related issue: [#128](https://github.com/bizz84/SwiftyStoreKit/issues/128))
- Add table of contents to README ([#346](https://github.com/bizz84/SwiftyStoreKit/pull/346))
📋 Changes
- Add `verifySubscriptions` method to check all subscriptions in a group at once ([#333](https://github.com/bizz84/SwiftyStoreKit/pull/333), related issue: [#194](https://github.com/bizz84/SwiftyStoreKit/issues/194))
- Rename `verifySubscription(type:productId:inReceipt:validUntil:)` to `verifySubscription(ofType:productId:inReceipt:validUntil:)` ([#333](https://github.com/bizz84/SwiftyStoreKit/pull/333))
- Add video tutorials section in README ([#328](https://github.com/bizz84/SwiftyStoreKit/pull/328), [#330](https://github.com/bizz84/SwiftyStoreKit/pull/330), see [#326](https://github.com/bizz84/SwiftyStoreKit/issues/326))
- Update iOS Demo App ([#327](https://github.com/bizz84/SwiftyStoreKit/pull/327), see [#147](https://github.com/bizz84/SwiftyStoreKit/issues/147))
📋 Changes
- Add `originalTransaction` to `PurchaseDetails` ([#323](https://github.com/bizz84/SwiftyStoreKit/pull/323), fix for [#302](https://github.com/bizz84/SwiftyStoreKit/issues/302))
- Bug fix: `completeTransactions` finishes failed transactions if `atomically: false` ([#322](https://github.com/bizz84/SwiftyStoreKit/pull/322), related issues: [#307](https://github.com/bizz84/SwiftyStoreKit/issues/307), [#288](https://github.com/bizz84/SwiftyStoreKit/issues/288))
📋 Changes
- Remove `localizedIntroductoryPrice` ([#320](https://github.com/bizz84/SwiftyStoreKit/pull/320), see [#319](https://github.com/bizz84/SwiftyStoreKit/issues/319), [#318](https://github.com/bizz84/SwiftyStoreKit/pull/318), [#315](https://github.com/bizz84/SwiftyStoreKit/pull/315))
📋 Changes
- Add `transactionDate` to `PaymentTransaction` ([#316](https://github.com/bizz84/SwiftyStoreKit/pull/316), see [#312](https://github.com/bizz84/SwiftyStoreKit/issues/312)).
- Add `localizedIntroductoryPrice` to `SKProduct` ([#318](https://github.com/bizz84/SwiftyStoreKit/pull/318)).
📋 Changes
- Add `fetchReceipt` method. Update `verifyReceipt` to use it ([#278](https://github.com/bizz84/SwiftyStoreKit/pull/278), related issues: [#272](https://github.com/bizz84/SwiftyStoreKit/issues/272), [#223](https://github.com/bizz84/SwiftyStoreKit/issues/223)).
- Update `fetchReceipt` and `ReceiptValidator` to use receipt as `Data` rather than `String`. This is consistent with `localReceiptData` ([#284](https://github.com/bizz84/SwiftyStoreKit/pull/284), see [#272](https://github.com/bizz84/SwiftyStoreKit/issues/272)).
- Remove `password` from `ReceiptValidator` protocol as this is specific to `AppleReceiptValidator` ([#281](https://github.com/bizz84/SwiftyStoreKit/pull/281/), see [#263](https://github.com/bizz84/SwiftyStoreKit/issues/263)). Note: This is an API breaking change.
- Unwrap `receipt["receipt"]?["in_app"]` in two steps (addresses casting problems) ([#283](https://github.com/bizz84/SwiftyStoreKit/pull/283), related issue [#256](https://github.com/bizz84/SwiftyStoreKit/issues/256)).
📋 Changes
- Update to swiftlint 0.22.0 ([#270](https://github.com/bizz84/SwiftyStoreKit/pull/270), fix for [#273](https://github.com/bizz84/SwiftyStoreKit/issues/273))
📋 Changes
- `ProductsInfoController`: Keep track of multiple completion blocks for the same request ([#259](https://github.com/bizz84/SwiftyStoreKit/pull/259), fix for [#250](https://github.com/bizz84/SwiftyStoreKit/issues/250))
📋 Changes
- Add support for the new SKPaymentTransactionObserver.shouldAddStorePayment method in iOS 11 ([#257](https://github.com/bizz84/SwiftyStoreKit/pull/257), related issue: [#240](https://github.com/bizz84/SwiftyStoreKit/pull/257))
- Update swiftlint to version 0.21.0 ([#258](https://github.com/bizz84/SwiftyStoreKit/pull/258))
📋 Changes
- Filter out all transactions with state == .purchasing early in purchase flows (related to [#169](https://github.com/bizz84/SwiftyStoreKit/issues/169), [#188](https://github.com/bizz84/SwiftyStoreKit/pull/188), [#179](https://github.com/bizz84/SwiftyStoreKit/issues/179))
- Sample app: print localized description when a purchase fails with `.unknown` error
📋 Changes
- Update to Xcode 9 recommended project settings ([#247](https://github.com/bizz84/SwiftyStoreKit/pull/247))
- Update build script iOS version to 10.3.1 ([#245](https://github.com/bizz84/SwiftyStoreKit/pull/245))
- Update notes about Xcode 9, Swift 4 support to README
📋 Changes
- Add `forceRefresh` option to `verifyReceipt` ([#224](https://github.com/bizz84/SwiftyStoreKit/pull/224), fix for [#223](https://github.com/bizz84/SwiftyStoreKit/issues/223))
📋 Changes
- Remove SKProduct caching ([#222](https://github.com/bizz84/SwiftyStoreKit/pull/222), related issue: [#212](https://github.com/bizz84/SwiftyStoreKit/issues/212))
- Adds new purchase product method based on SKProduct
📋 Changes
- Adds Danger for better Pull Request etiquette ([#215](https://github.com/bizz84/SwiftyStoreKit/pull/215)).
- Adds xcpretty to improve build logs ([#217](https://github.com/bizz84/SwiftyStoreKit/pull/217))
- Update SwiftLint to 0.18.1 ([#218](https://github.com/bizz84/SwiftyStoreKit/pull/218))
**API removed: `refreshReceipt`** This release simplifies the receipt verification flows by removing the `refreshReceipt` method from the public API. Now clients only need to call `verifyReceipt` and the receipt is refreshed internally if needed. Addressed in #213, related issue: #42. The documentation in the README and various methods has also been considerably improved.
This is a minor release to ensure callbacks are dispatched on the main thread on macOS. PR #214, fix for #211.
This is a critical fix for #208. If you're using release 0.9.0, please update.
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: ```swift 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)") } } ```
