-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Purchase doesn't work properly with Amazon's Live App Testing #1049
Comments
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out! |
Hi @enoiu, |
Thank you for your response. debug logs (containing "purchase".)
|
Thanks for sending that over @enoiu . Looks like we are crashing with a null value in the JSON we get from the backend. Let me look into it, since it looks like we may have a bug, and I will report back. |
@enoiu I am still trying to reproduce, but one thing I've noticed is that you are using an Entitlement sku. Does this happen also with subscriptions or consumables? I don't see anything weird in the response we sent from the backend to that device that could cause this. |
@enoiu I think I've identified the bug. It's in the |
In `PurchaseCompleted` we are passing a Flutter's `StoreTransaction` in the callback. This is very confusing but: - In Android `StoreTransaction` is what's returned after a successful purchase. This class has a nullable `orderId` - In Android `Transaction` is the transactions in the CustomerInfo. This class has a non-nullable `transactionIdentifier` The issue we are having is that in Flutter we only have one `StoreTransaction` with a non-nullable `transactionId`, and we are using it in both places, the `PurchaseCompleted` and `CustomerInfo`. I see several ways of fixing this: - Making transactionIdentifier nullable. I don’t like this. It’s breaking - Making transactionIdentifier an empty string. Fixing it in next major - Making transactionIdentifier an empty string, deprecating it and creating orderId which is nullable and the same as transactionIdentifier. We’ll have nullable orderIds in the customer info transactions where this object is also used. In Android we have two classes, one for CustomerInfo transactions (Transaction with non-nullable transactionId ) and StoreTransaction which is used for completed purchases - Making a copy of StoreTransaction and name it CompletedPurchase , but with a nullable transactionIdentifier. Also breaking since we need to modify the PurchaseCompleted callback to receive this object. Making a new callback won’t work because the broken `PurchaseCompleted will keep crashing. In this PR I am doing number 2, since it's the least breaking. This only affects apps using Amazon paywalls, which is not many. Will fix #1049
We just merged a fix for this. We'll ship the fix in the next release. Sorry about the trouble |
Thank you very much for your great work. |
In `PurchaseCompleted` we are passing a Flutter's `StoreTransaction` in the callback. This is very confusing but: - In Android `StoreTransaction` is what's returned after a successful purchase. This class has a nullable `orderId` - In Android `Transaction` is the transactions in the CustomerInfo. This class has a non-nullable `transactionIdentifier` The issue we are having is that in Flutter we only have one `StoreTransaction` with a non-nullable `transactionId`, and we are using it in both places, the `PurchaseCompleted` and `CustomerInfo`. I see several ways of fixing this: - Making transactionIdentifier nullable. I don’t like this. It’s breaking - Making transactionIdentifier an empty string. Fixing it in next major - Making transactionIdentifier an empty string, deprecating it and creating orderId which is nullable and the same as transactionIdentifier. We’ll have nullable orderIds in the customer info transactions where this object is also used. In Android we have two classes, one for CustomerInfo transactions (Transaction with non-nullable transactionId ) and StoreTransaction which is used for completed purchases - Making a copy of StoreTransaction and name it CompletedPurchase , but with a nullable transactionIdentifier. Also breaking since we need to modify the PurchaseCompleted callback to receive this object. Making a new callback won’t work because the broken `PurchaseCompleted will keep crashing. In this PR I am doing number 2, since it's the least breaking. This only affects apps using Amazon paywalls, which is not many. Will fix RevenueCat#1049
Environment
flutter doctor
purchases-flutter
Fire OS 8.3.2.3
in Amazon's Live App Testing
Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Describe the bug
I implemented in-app purchases using
PaywallFooterView
and tested purchases with Amazon's Live App Testing.Then, even though the Amazon Appstore UI shows that the purchase is complete,
PaywallFooterView
'sonPurchaseCompleted
does not seem to be triggered.When checking with Logcat, the following error occurred.
(This error was displayed after the log
RevenueCatUI D Dismissing paywall after purchase
.)However, afterwards restoring purchases (
onRestoreCompleted
) worked fine.I tried resetting the in-app items from the Amazon Developer page multiple times, but the result did not change.
Additional context
I don't know if it is directly related to this issue, but another app that was published on the Amazon Appstore was suspended due to in-app purchases not working properly.
The reason for the suspension was "Even after purchasing IAP, it does not reflect in the app as app asks for purchase again for using other pro features but displays message as IAP is already purchased."
This app used
purchases_flutter: ^6.5.1
and did not usepurchases_ui_flutter
.I then submitted an update for the app with
purchases_flutter: ^6.24.0
, but it was rejected because "Observed that IAP Item is not delivered as expected to the user post purchase."However, in the case of this app, Purchase worked fine on my actual device (Fire 7 2022, FireOS 8.3.2.2).
Furthermore, perhaps because the app has been suspended, I can no longer install this app that I submitted to the live app test after uninstalling it, so I am currently unable to test this app on my device.
Therefore, I decided to try using
purchases_ui_flutter
with another app, and the issue I reported this time was confirmed.The text was updated successfully, but these errors were encountered: