-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
getAvailablePurchases on iOS let appear a dialog "Sign in to iTunes Store" #747
Comments
When in development, this shows so that you can login with your sandbox account. I don’t believe the docs are very clear on this. |
I think for production it may also show a prompt whenever calling this function, right? The way I implemented this is I call this when the user presses "restore purchase" and after purchaseUpdatedListener is called. To know whether the user has a subscription in the future I store it in backend and present it to the app. |
Hey @voxspox @alexpchin is right. @alexpchin Since we are working on the bridge, we assume that people might know little bit about |
I've seen a few apps with that function. I don't quite remember now but I think it is needed (or required by apple) in some cases. Also in Apple's app store guideline examples they have this button: Also I thought it would be bad UX if the user ever has to enter their apple ID when opening my app, i think that would be confusing. (i've seen this happen before if session is expired or something happens with SSL MITM which is often the case with public wifi landing pages) edit: actually seems that apple requires it |
Is there maybe a way to know before calling |
1+ same |
Hi guys, any answer on this? as I understand this is a debugging functionality but I'm testing with testflight and I want to prevent this from happening, is is it possible to somehow leave the sandbox mode? |
Meanwhile, I have found solution for me. I introduced a new variable Init:
On app start:
On purchase:
Settings:
The user will never see the connect-iTunes-prompt again. The restoring only happens after a purchases was done and thus the credentials have been already typed in + stored and the prompt will not be shown. |
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. |
Hello, |
|
I'd like to work out if this would also happen in production, rather than just TestFlight. |
Apple still advices us not to call this function on app automatically or startup
The way I implemented it is to send the receipt to the backend when the user presses purchase or restore purchase. Then the backend can provide the app with the subscription status in the future. |
For an auto-renewing subscription, how do you get the latest receipt without uploading from the client? |
By running a periodic polling in the backend that periodically validates every purchase like this Then take the latest receipt from the validation (which comes from google/apple server) and save it back to the database. |
Hi @mifi Thanks for the quick response! I have stored the |
Yes the |
Thanks @mifi That has really helped my understanding! It just seemed odd to send the "latestReceipt" to receive the "latestReceipt" |
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. |
Version of react-native-iap
3.4.13
Version of react-native
0.60.5
Platforms you faced the error (IOS or Android or both?)
iOS
Expected behavior
getAvailablePurchases has no side effects
Actual behavior
Calling
getAvailablePurchases
on iOS let appear a dialog "Sign in to iTunes Store".This does not happen on Android.
I'm calling
getAvailablePurchases
during app start to restore the purchased items. According to the documentation I understood that this is the common way, right?To restore the purchased items I'm calling
getAvailablePurchases
based on changes of AppState. Unfortunately the AppState is not only triggered on app start but also p.ex. after returning to the app from a dialog (caused by the app) p.ex. Sign In to iTunes... :(For the user this is bothering. Especially if the user is not intending to buy something he would not want to enter his credentials to get rid of this dialog.
Tested environment (Emulator? Real Device?)
real device
Steps to reproduce the behavior
call getAvailablePurchases
The text was updated successfully, but these errors were encountered: