Skip to content

Commit

Permalink
Fix Readme; Create changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Tikhonenko committed Oct 16, 2021
1 parent b0f1a88 commit 4bb3226
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
Binary file removed .gitignore.swp
Binary file not shown.
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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<String> = ["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()
```

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/)
Expand Down
7 changes: 7 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4bb3226

Please sign in to comment.