-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
PurchaseUpdateListners not being called on production iOS build #1146
Comments
I think you need to initially call validateReceiptIos with a false parameter first, and then if that call returns a 21007 then you call it with true. That way it will work in both prod and sandbox. That's something I ran into. |
I am having this same issue even with "isTest" set to "false" in calling RNIap.validateReceiptIos(). Testing on an actual device with "isTest" set to "true" seems to work but when pushed to production is does not work. |
Definitely when you validate the receipt validate in production (use false param), then if that returns with a status of 21007, validate in the sandbox (use true param). Then after calling finishTransactionIOS(), also call finishTransaction(). Hope that helps! |
@the-dut awesome! Going to give that configuration a try. Will report back what happens :D. I just wish Apple and Google had more solid abilities for devs to test before going through the process of release flows just to fined out our code doesn't work :/. |
@the-dut ok now I am getting endless password / log in prompts after calling RNIap.requestSubscription([productId]) |
It could be all the previous requests coming through that were never finalized. Could be hundreds or thousands based on how much you've tested. Maybe once you get through them you might be ok. ALso, are you testing on a real device? Local or TestFlight? Are you using a Sandbox user or a production id? And if sandbox user, do you have that id set up in your phone as a Sandbox user? I never saw that issue. But I can try to help. |
ALso, are you testing on a real device? Local or TestFlight? Are you using a Sandbox user or a production id? And if sandbox user, do you have that id set up in your phone as a Sandbox user? here is my code purchaseUpdatedListener():
validatePurchase():
|
Is there a reason you have the finishTransactionIOS commented out? You should do both finishTransactionIOS() and then finishTransaction() |
I could be confused but I thought this description in the README meant to only use "finishTransaction" if using v4.1.0 or later. Or does it mean to use both of them as you suggest? I am currently using v4.5.4.
|
Great point! I do both just in case. |
well, either way it never gets to those lines yet, lol. I will uncomment that line. Anymore I am willing to try anything to get this working :D |
Just upgraded to v5.0.0 hoping something might of changed but no dice. Still getting multiple pwd prompts. I am getting 2 at a time and after second prompt it errors out with "E_UNKNOWN" cannot connect to iTunes. |
Does it all start happening right when you add your updatedpurchaselistener? If so, you may need to just get through all of the unfinished transactions first. Or.. use your real apple id instead of the test user. |
it all happens right at "requestSubscription()". I never see another console log after that. The only console log I see after requestSubscription executes is "Purchase Started !". The next console log is "Purchase Failed!!" followed by the "E_UNKNOWN" errors inside of "puchaseErrorListener". |
Did you try with your real Apple ID? |
I have not tried that yet. Do I need to add my real Apple ID as a tester? |
No. You can just use it I would think. |
Using my Apple ID it only prompts me once and gives the "E_UNKOWN" error immediately. |
just tried testing with a newly created Sandbox User but no dice. 2 pwd prompts and error. |
what's really odd and I know it's not suppose to be this way now, is I use to have "finishTransaction()" before validating the receipt and it worked that way. |
Quick update. @the-dut I submitted a build with everything setup how you suggested (to TestFlight) and it worked!! So now I am throwing caution to the wind and submitted it for production. |
That's great news! Let us know how it goes! |
Thanks to all having discussions and sharing benefits in the current thread ❤️ |
Sorry for the delayed report. Forgot to add it works in production!! Next up....accepting promotions so I can give my app for free to friends and family 😁 |
@BStenfors9119 what was the problem at all? Can you share exactly how you solve the problem? Thank you very much. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
let receipt = purchase.transactionReceipt; does not return anything returns empty string |
Hello everyone,
I am not sure what actually happen with my code. I integrated the react-native-iap plugin into my iOS application. And it was working fine on local build or testflight build but when i release the mobile version of application and i made the subscription but nothing happened next. I assumed that purchaseUpdateListeners are not working on production build then i removed the listeners and write the code just after the requestSubscription send the response. And released the next version of application but still the same issue even getReceiptIOS not called. I am stuck into this. Help me to find out from this.
Here is my code : -
const purchases = await RNIap.requestSubscription(productId);
console.log(purchases, "purchase...")
this.validateTransactionReceipt(purchases);
validateTransactionReceipt method : -
validateTransactionReceipt = (purchase) => {
const receipt = purchase.transactionReceipt;
if (receipt) {
AppEventsLogger.logEvent("Subscription transaction receipt validated", { type: 'owner' });
const receiptBody = {
'receipt-data': purchase.transactionReceipt,
'password': subscriptionSecret
};
Thanks
The text was updated successfully, but these errors were encountered: