Skip to content
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 crash #771

Closed
doomsower opened this issue Oct 7, 2019 · 2 comments · Fixed by #774
Closed

Android crash #771

doomsower opened this issue Oct 7, 2019 · 2 comments · Fixed by #774

Comments

@doomsower
Copy link
Contributor

Version of react-native-iap

4.0.2

Version of react-native

0.61.2

Platforms you faced the error (IOS or Android or both?)

Android

Expected behavior

purchase should work

Actual behavior

I'm getting android crash with this error:

Cannot convert argument of type class com.android.billingclient.api.Purchase

This is the cause:

DoobooUtils.getInstance().resolvePromisesForKey(PROMISE_BUY_ITEM, purchases.get(0));

react promise should be resolved with WritableMap and not with Purchase.

Btw, I noticed two very similar pieces of code, when Purchase is converted into WritableMap, here and here. They're different all but in a couple of fields. Maybe this can be extracted into utility function?

Tested environment (Emulator? Real Device?)

Steps to reproduce the behavior

@kabucey
Copy link

kabucey commented Oct 8, 2019

FWIW I'm getting this same error but on React Native version 0.60.6.

hyochan added a commit that referenced this issue Oct 8, 2019
@hyochan
Copy link
Owner

hyochan commented Oct 8, 2019

Can you please try 4.0.3? I've just fixed the code as @doomsower has pointed out. Please feel free to reopen when it still cause a problem.

@hyochan hyochan closed this as completed Oct 8, 2019
@hyochan hyochan mentioned this issue Oct 8, 2019
hyochan added a commit that referenced this issue Oct 8, 2019
hyochan added a commit that referenced this issue Oct 8, 2019
* Resolve #771
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants