From 4bb32268300883132908fe05c125286dab465da2 Mon Sep 17 00:00:00 2001 From: Pavel Tikhonenko Date: Sat, 16 Oct 2021 22:29:00 +0300 Subject: [PATCH] Fix Readme; Create changelog --- .gitignore.swp | Bin 12288 -> 0 bytes CHANGELOG.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 ++- TODO.md | 7 +++++++ 4 files changed, 55 insertions(+), 1 deletion(-) delete mode 100644 .gitignore.swp create mode 100644 CHANGELOG.md create mode 100644 TODO.md diff --git a/.gitignore.swp b/.gitignore.swp deleted file mode 100644 index cd19134faceda3612a9997c4e0021670aaf997bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2ONbmr7{@DOq9#T|1ieWm3qF=iS9T+kg9w7?O``}NBtb?0U-!J$#2kzV1GVtm>8{6DU;XP} z)jMoA_n$nz!VgA^3_rUVd)dYEyJIJJ#Jw%d>u$#sRB`>Ex?Pl-SfUv#6T~Ht>aKj4hWCs=(_EVU-y?gjQyHDJ3#1J4T5EKXs1O)RQ76}$qT0SX)gi(mn8a6h;Ro!6d5j9JlCM;TBKfCU$_ulmC z`tf{2#a^3y4Xtq{@QM!acwe}~Lf{p-PT7oNlZg$}$#b)C=+Q-?$6Z>+Rs*5Ok(O7M z=c>IePpZ zCav$_P8=lzRt}pKEp=4fg)WYQBnbvbwyDk`U5gJ*$@?;gXokz4(Fu>Kxz5`Vme;D+ zhHF`q@o~^;9>}hq!MKVRnzqMefBgr;(u$t0Y(Enfao0>j+Td!kpGut|qu9ho7O0Jk zZHv-jKJ{-nYFtB3or9grG->EYHSGolYEZXEqTwJc->{)`ZyHzGk94d1@{KZS!$|NW z3awLVYhSg%I2^DYb0}(ZT)+vmRf*E|Y}Rrzz9)_#_irA{v2D z->Z%IFhQ9f6aD`6{#Gy zttsP2bC}1ZH5PF`O4grT8GS_Obb(7hW0X9YD9u_mgHB9t?|BgYng-s)b1vT}`Tr z=71iN6n1iz87xpkI_yfe>2W$TC{o5jUBEI;ooYYil{IQJ9jJDXk~Y;icps`>C8w=H z*0t*C5?d69yT{Q-rFEZ29ws#gakZUs=v6l^&YEe7r#1F6iS&;n9{d+09>R!IyW%vO z<0qg3J#{EAtm7P?ya-Qw$y?pTHnHw7W|66^Nlz8S%K}?K@nflJ%2ZUdnQrubw6OKM UHI}Bu`~hAq^|YkgE>&mt7b3`fegFUf 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 +