Skip to content

Commit

Permalink
Merge pull request #1 from twitchalerts/bugfix/android_purchase_crash
Browse files Browse the repository at this point in the history
* On android for inapp products. Fixed NullPointerException: offerTok…
  • Loading branch information
mchykin authored Mar 8, 2024
2 parents e01ff81 + 7cca3b9 commit 57baba2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 5.6.2
* On android for inapp products. Fixed NullPointerException: offerToken is required for constructing ProductDetailsParams
## 5.6.1
* Erroneous duplicate item by @deakjahn in https://github.com/dooboolab-community/flutter_inapp_purchase/pull/441
* Fixed consumable products reading on Android by @33-Elephants in https://github.com/dooboolab-community/flutter_inapp_purchase/pull/439
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,10 @@ class AndroidInappPurchasePlugin internal constructor() : MethodCallHandler,
if (offerToken == null) {
offerToken = selectedProductDetails.subscriptionOfferDetails!![0].offerToken
}

productDetailsParamsBuilder.setOfferToken(offerToken)
} else {
offerToken = selectedProductDetails.subscriptionOfferDetails!![0].offerToken
}
productDetailsParamsBuilder.setOfferToken(offerToken)

val productDetailsParamsList = listOf(productDetailsParamsBuilder.build())

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flutter_inapp_purchase
description: In App Purchase plugin for flutter. This project has been forked by
react-native-iap and we are willing to share same experience with that on
react-native.
version: 5.6.1
version: 5.6.2
homepage: https://github.com/dooboolab/flutter_inapp_purchase/blob/main/pubspec.yaml
environment:
sdk: ">=2.15.0 <4.0.0"
Expand Down

0 comments on commit 57baba2

Please sign in to comment.