diff --git a/.gitignore.swp b/.gitignore.swp deleted file mode 100644 index cd19134..0000000 Binary files a/.gitignore.swp and /dev/null differ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5f413d7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,46 @@ +CHANGELOG +========= + +Mercato 0.0.1 +--------- + +* Listen for transaction updates. If your app has unfinished transactions, you receive them immediately after the app launches + ```swift + Mercato.listenForTransactions(finishAutomatically: false) { transaction in + //Deliver content to the user. + + //Finish transaction + await transaction.finish() + } +``` + +* Fetch products for the given set of product's ids + ```swift + do + { + let productIds: Set = ["com.test.product.1", "com.test.product.2", "com.test.product.3"] + let products = try await Mercato.retrieveProducts(productIds: productIds) + + //Show products to the user + }catch{ + //Handle errors + } + ``` + +* Purchase a product + ```swift + try await Mercato.purchase(product: product, quantity: 1, finishAutomatically: false, appAccountToken: nil, simulatesAskToBuyInSandbox: false) + ``` + +* Offering in-app refunds + + ```swift + try await Mercato.beginRefundProcess(for: product, in: windowScene) + ``` + +* Restore completed transactions + + ```swift + try await Mercato.restorePurchases() + ``` + diff --git a/README.md b/README.md index 53d832c..3ea3836 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ do #### Purchase a product ```swift -try await Mercato.purchase(product: product, quantity: 1, atomically: false, appAccountToken: nil, simulatesAskToBuyInSandbox: false) +try await Mercato.purchase(product: product, quantity: 1, finishAutomatically: false, appAccountToken: nil, simulatesAskToBuyInSandbox: false) ``` #### Offering in-app refunds @@ -103,6 +103,7 @@ try await Mercato.restorePurchases() ``` ## Essential Reading + * [Apple - Meet StoreKit 2](https://developer.apple.com/videos/play/wwdc2021/10114/) * [Apple - In-App Purchase](https://developer.apple.com/documentation/storekit/in-app_purchase) * [WWDC by Sundell - Working With In-App Purchases in StoreKit 2](https://wwdcbysundell.com/2021/working-with-in-app-purchases-in-storekit2/) diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..be2338c --- /dev/null +++ b/TODO.md @@ -0,0 +1,7 @@ +- [ ] Create example project based on Apple one +- [ ] Get active subscription products +- [ ] Download hosted content before finish transaction +- [ ] Check whether product has an active subscription +- [ ] Check whether product is refunded +- [ ] Access unfinished transactions +