-
-
Notifications
You must be signed in to change notification settings - Fork 659
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
iOS 14: requestSubscription() issues #1120
Comments
Same here. Any one can helps? |
Not hanging, but returns |
For us the purchase dialog shows, and the purchase listener gets called correctly, but the |
Seems like this might have been resolved here #1064 |
I applied that promise fix previously, so that's not the problem here. |
Works for me with iOS14, here's how I did it: |
I was calling the method with the boolean parameter false, which I think is the recommendation. I removed that and am still seeing very strange behavior on iOS14 no matter how I call the method, and it works fine on an iPhone and iPad running iOS 13 via TestFlight. I tested requestSubscription with and without the boolean and I am never getting the purchase dialogs on iOS 14. Now most times it calls RequestUpdatedListener immediately with what looks like an invalid receipt. Are there others who are having no problems with their subscriptions in iOS14 and xCode 12 using TestFlight? |
Hey, do you any of you use |
I do getAvailablePurchases() earlier in the flow - on app load, the screen right before my Subscription Screen. |
yeah, unfortunately this seem to be a bug in iOS 14. No fault of this plugin. I've checked in native code and it is the same issue. |
That was the problem. I removed the call to getAvailablePurchases() and the purchase popups occurred and purchase was successful. Regrettably, I need to make that call to getAvailablePurchases, since I check the status of their subscription on App Load. So looks like we need to wait for a iOS 14 patch to fix this? Nothing else anyone can do? By the way, thank you so much theDev23! |
You're welcome, the-dut. Your best bet is probably relying on a server-based check. |
I was hoping to avoid having a server do this. Is it as easy as copying the code from my react into something like a Firebase Cloud Function? Or is this something that needs to be re-architectured? Probably a dumb question, but hey.. we all started out asking dumb questions. :) |
Beverage of your choice if you're ever in the Midwest US. :) |
Same issue here affecting live users. @theDev23 do you happen to have a link any discussions about the issue in iOS? Are there any timelines for a fix? |
@nicknjpconsultingllc no link, sorry. I did the digging myself. @the-dut I am using Firebase Cloud Functions as well. Check out this repo. |
I ended up saving the receipt to a database on successful purchase in the purchaseUpdatedListener, then on app load I pull the receipt from the database, validate it again and check to see if it's expired or not. That allowed me to get rid of the call to getAvailablePurchases() is it works great in iOS14. It's worked really well so far and is much faster. Now a question on how far I need to take this. If this is all I do, will the UpdatedPurchaseListener get called on all updates to the subscription (basically the auto-renewals) until I finish the transactions? Or do I need to implement the server-to-server notifications to get informed of the auto-renewals? It almost seems like using the UpdatedPurchaseListener is a better (and simpler) solution since I have been reading the server-to-server integration isn't perfect. |
Still getting this issue after removing getPurchaseHistory and applying the promise fix. Can't get to make the purchase dialog pop up. Can anybody help? |
I'd say take a look at any/all calls you are making to AIP before doing the request to purchase. Are you calling getAvailablePurchases() as well? |
I can't exclude the calls to getAvailablePurchases() and getPurchaseHistory(), is there anyway to make it requestSubscription() pop up the purchase menu with these calls? |
Hi @HamzaIkram2727 , if I am not wrong, you can just create a new sandbox account to use and delete the old one. It should works. |
@the-dut Even I am not using any getAvailablePurchases() and getPurchaseHistory() calls, still i am facing same problem. It does not show purchase dialog but purchased sucess automatically. I am also calling finishTrsanactionIOS and finishTransation functions |
I managed to get the iOS native purchase dialog by exiting the app. This looks to me like some promises finally resolved. I'm not sure if there's any promise dependencies in |
I'm having the same problem with getAvailblePruchases(), most of the times the promise does not resolve or reject. It started happening when testing on iOS 14 devices. |
Possibly related: |
Correction: using a brand new account together with the fix suggested by @andresordonezfm makes it work on my end. Without the fix, after the very first subscription, the same behavior I was experiencing before emerges again and I can no longer subscribe again. One more thing I noticed after applying the fix is that subscriptions appear to no longer auto-renew automatically, not even once, although using sandbox they are expected to renew 5 times. |
Added a promise to the clearTransaction function, to wait until it finishes clearing open transactions hyochan#1120
Added a promise to the clearTransaction function, to wait until it finishes clearing open transactions hyochan#1120
Added a promise to the clearTransaction function, to wait until it finishes clearing open transactions hyochan#1120
Hi, dude sorry for the delay again. I created a pull request to react-native iap |
Hi dude I think it is a sandbox problem. Do you keep giving that behavior? |
@andresordonezfm yes, I too suspect it is an issue with Apple's sandbox. I didn't perform any more tests since my last comment and I'm yet to check production. However, to date, I didn't receive any complaints from customers. |
The sandbox appears to be back on track on my end when using a brand new account, as previous reported by @Paduado, without any making any changes to the code. 🤷♂️ 😕 |
@andresordonezfm I encountered the same thing and your patch seams to fix it. However, I think I see subtle bug in your code that could potentially cause
In practice, I've only seen |
Solution recommended by rusty120 to avoid a possible deadlock in the promise of the clearTransactionsIOS hyochan#1120 (comment)
Hi dude, thank you for you recommendation. I tested your propose and it works well for me. I made a pull request with that change. Note: Yes, I reviewed that documentation but since it only is fired from transaction to transaction I did not implement it. But it is a very good recommendation. Thank you! |
Solution recommended by rusty120 to avoid a possible deadlock in the promise of the clearTransactionsIOS #1120 (comment)
I use getPurchaseHistory(). when i use this, no purchase dialogs in requestSubscription. |
I find that there's no problem, it's just extremely slow, like 5 - 10mins to init the iap, or get the history or clear transaction, the first time purchase is ok, after the first time purchase, dont know why it's so slow |
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. |
Working solution,First and Second steps code was already in my llibrary.
works for me. Thanks a ton |
Fixed by adding 5 second delay before requestSubscription |
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. |
* Bug Fix clearTransaction promise Added a promise to the clearTransaction function, to wait until it finishes clearing open transactions hyochan/react-native-iap#1120 * BigFix clearTransaction promise Added a promise to the clearTransaction function, to wait until it finishes clearing open transactions hyochan/react-native-iap#1120
Solution recommended by rusty120 to avoid a possible deadlock in the promise of the clearTransactionsIOS hyochan/react-native-iap#1120 (comment)
* Bug Fix clearTransaction promise Added a promise to the clearTransaction function, to wait until it finishes clearing open transactions hyochan/react-native-iap#1120 * BigFix clearTransaction promise Added a promise to the clearTransaction function, to wait until it finishes clearing open transactions hyochan/react-native-iap#1120
Solution recommended by rusty120 to avoid a possible deadlock in the promise of the clearTransactionsIOS hyochan/react-native-iap#1120 (comment)
Version of react-native-iap
4.4.9
Version of react-native
.62.2
Platforms you faced the error (IOS or Android or both?)
iOS only. Not testing on Android yet.
Expected behavior
Purchase dialog pops up to complete buy and then purchaseUpdatedListener called.
Actual behavior
call requestSubscription(). No purchase dialogs. PurchaseUpdatedListener called immediately with no purchase dialogs or valid receipt.
Tested environment (Emulator? Real Device?)
Real iOS 14 device using TestFlight.
Steps to reproduce the behavior
call RNIap.requestSubscription().
Notes:
The text was updated successfully, but these errors were encountered: