Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Handle restored purchases in iOS example app (#4392)
Browse files Browse the repository at this point in the history
  • Loading branch information
BeMacized committed Sep 29, 2021
1 parent 1ef4405 commit fe31e52
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/in_app_purchase/in_app_purchase_ios/CHANGELOG.md
@@ -1,5 +1,6 @@
## NEXT
## 0.1.3+5

* Updated example app to handle restored purchases properly.
* Update dev_dependency `build_runner` to ^2.0.0 and `json_serializable` to ^5.0.2.

## 0.1.3+4
Expand Down
Expand Up @@ -399,7 +399,8 @@ class _MyAppState extends State<_MyApp> {
} else {
if (purchaseDetails.status == PurchaseStatus.error) {
handleError(purchaseDetails.error!);
} else if (purchaseDetails.status == PurchaseStatus.purchased) {
} else if (purchaseDetails.status == PurchaseStatus.purchased ||
purchaseDetails.status == PurchaseStatus.restored) {
bool valid = await _verifyPurchase(purchaseDetails);
if (valid) {
deliverProduct(purchaseDetails);
Expand Down
2 changes: 1 addition & 1 deletion packages/in_app_purchase/in_app_purchase_ios/pubspec.yaml
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase_ios
description: An implementation for the iOS platform of the Flutter `in_app_purchase` plugin. This uses the iOS StoreKit Framework.
repository: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase/in_app_purchase_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 0.1.3+4
version: 0.1.3+5

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down

0 comments on commit fe31e52

Please sign in to comment.