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
[Android] Getting "purchase is not suitable to be purchased" #964
Comments
I found a workaround: before calling |
Ok, found the problem: I accidentally stripped the Android-specific properties from the purchase object, that's why re-fetching solved my problem. Now, after getting rid of this code, all works as expected 👍 |
@drbarto can you please share a bit more details regarding your fix? I started seeing same errors in the crash reporting tool, but they're not consistently happening and I'm unable to reproduce them locally 🤔 |
@haikov sorry, but my "fix" is for sure not applicable to you. I have a helper function which converts the purchase JSON data which I receive from RNIap to something our backend can digest, and in this function I accidentally forgot to copy some Android-specific data fields. |
'purchase is not suitable to be purchased' I see this too for old test payments. I cannot call finish transaction on them. |
RN: 0.61.5
RNIap: 4.4.3
Platform: Android
Expected: calling
finishTransaction
succeedsActual:
finishTransaction
fails with "purchase is not suitable to be purchased"Test env: real device
I'm integrating RNIap into a new app (so no real-world experiences yet) in order to purchase a non-consumable product. The iOS part works fine, but on Android I recently started to consistently get the error "purchase is not suitable to be purchased" when calling
RNIap.finishTransaction
.Looking at the code, this indicates that my purchase is not considered to be purchased (
!purchase.isAcknowledgedAndroid && purchase.purchaseStateAndroid === PurchaseStateAndroid.PURCHASED
isfalse
).I'm pretty sure that my general setup (product id, native app configuration, etc.) is correct because a) the process works on iOS and b) it also used to work on Android until recently.
Some additional background: when starting the app in test mode I try to clean up any leftover data by following resolve unacknowledged purchase and consume owned items to avoid "already owned" error. Disabling those calls did not make a difference though.
Anyone has a hint what might be wrong in my setup?
The text was updated successfully, but these errors were encountered: