Closed virajtalaviya closed 1 year ago
because inapp product detail:selectedProductDetails.subscriptionOfferDetails is null
Version of flutter_inapp_purchase
5.4.1
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
should show more details of the error
Actual behavior
showing this error while requesting purchase with no more specifications why it is coming up
Tested environment (Emulator? Real Device?)
Real device
Hey I got the same error. I solved it by these steps.
if (offerToken == null) { offerToken = selectedProductDetails.subscriptionOfferDetails!![0].offerToken } val productDetailsParamsList = listOf(ProductDetailsParams.newBuilder() .setProductDetails(selectedProductDetails) .setOfferToken(offerToken) .build())
if (offerToken == null) { offerToken = selectedProductDetails.subscriptionOfferDetails?.get(0)?.offerToken } val productDetailsParamsList = listOf( if(offerToken == null) ProductDetailsParams.newBuilder() .setProductDetails(selectedProductDetails) .build() else ProductDetailsParams.newBuilder() .setProductDetails(selectedProductDetails) .setOfferToken(offerToken) .build() )
It would be nice if this fix made it into the official release...
@virajtalaviya Why did you close this issue? It doesn't seem to be fixed yet.
@mdusaama0 Your workaround works well! Thank you. Is anyone able to make an pull request for this?
The PR was sent in April... https://github.com/dooboolab-community/flutter_inapp_purchase/pull/423
Version of flutter_inapp_purchase
5.4.1
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
should show more details of the error
Actual behavior
showing this error while requesting purchase with no more specifications why it is coming up
Tested environment (Emulator? Real Device?)
Real device