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

Failure in requestPurchase #788

Closed
meanking opened this issue Oct 11, 2019 · 11 comments
Closed

Failure in requestPurchase #788

meanking opened this issue Oct 11, 2019 · 11 comments
Labels
🤖 android Related to android 🙏 help wanted Extra attention is needed 👣 waiting for response Need feedback to continue

Comments

@meanking
Copy link

meanking commented Oct 11, 2019

#769 I got error.
I am using react-native-iap 4.0.4

And I updated according to modified version of it.
By the way I got this error.
How can I fix this problem?

Screenshot_20191011-072309_DazzledDate

@hyochan
Copy link
Owner

hyochan commented Oct 11, 2019

Have you seen #784?

@hyochan hyochan added 🤖 android Related to android 🙏 help wanted Extra attention is needed 👣 waiting for response Need feedback to continue labels Oct 11, 2019
@meanking
Copy link
Author

meanking commented Oct 11, 2019

Yes,

By the way, at first I got this error when I load the page with react-native-iap.
This error occurs after rendering DOM.

Screenshot_20191011-064505_DazzledDate

How can I fix this?
I think the problem is in this part.

purchaseUpdateSubscription = purchaseUpdatedListener(async (purchase) => {
console.log('purchaseUpdatedListener', purchase);
if (
purchase.purchaseStateAndroid === 1 &&
!purchase.isAcknowledgedAndroid
) {
try {
const ackResult = await acknowledgePurchaseAndroid(
purchase.purchaseToken,
);
console.log('ackResult', ackResult);
} catch (ackErr) {
console.warn('ackErr', ackErr);
}
} this.setState({ receipt: purchase.transactionReceipt }, () => this.goNext(), ); });`

@hyochan
Copy link
Owner

hyochan commented Oct 11, 2019

Please try 4.0.6 and come back.

@meanking
Copy link
Author

meanking commented Oct 11, 2019

I am using 4.0.6
By the way, when I click one product for purchase, the error is occurred yet.

Screenshot_20191011-072309_DazzledDate

Please let me know how I can fix this.
Thanks

@hyochan
Copy link
Owner

hyochan commented Oct 11, 2019

Could you try out the example project?

@meanking
Copy link
Author

Yes, I tried to do it same as your sample code.

@meanking
Copy link
Author

What is the cause of this error?

@hyochan
Copy link
Owner

hyochan commented Oct 12, 2019

Is there anyone facing the same issue?

@AlifElahi
Copy link

I am facing the same problem, have you found any solve for this @meanking

@diegogurpegui
Copy link

Still happening to me with 4.3.3 (and RN 0.59.10)
The Java file seems to be expecting 6 params (plus the result promise), and the JS code seems to be sending 6. So I don't know where the "expected 8" comes from.
I tried cleaning every compile/build file I found.

Any luck anyone?

@diegogurpegui
Copy link

Fixed it!

I tried to reset the cache to Metro Bundler with no luck.

But after that I changed the JS code of the library (file node_modules\react-native-iap\index.js) to add a log. That changed made some cache (which I'm unaware of) to refresh. And after that everything worked fine.
Needless to say I removed the log line and everything kept working.

Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android Related to android 🙏 help wanted Extra attention is needed 👣 waiting for response Need feedback to continue
Projects
None yet
Development

No branches or pull requests

4 participants