-
Notifications
You must be signed in to change notification settings - Fork 184
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
Check if in-app purchase has been made on start #88
Comments
Receipt validations are ideally performed on a server. This allows you to protect your API keys that something like I'd highly encourage you to look into a
Hope this helps. |
@Twansparant afaik, there is no way of knowing if the user is logged is to the App store. The best option and what I'm doing atm is to verify if the receipt exists before requesting. You can see my pull request for that: #126 You then check if the receipts exists first, if not: Tell the user that you need to verify the existence of the purchase. Proceed to verify the receipt. If receipt is found, grant access and continue. |
@Twansparant you could easily setup an AWS Lambda + API GateWay endpoint that validates the purchases and subscriptions. You would just call This way the user won't get prompted to login all the time if you use |
Hi there,
I'm a bit lost on how to achieve the following workflow:
When opening my app, check if the currently logged in user (in App Store) has already purchased my in-app purchase by either checking a local storage item and if not present, checking existing receiptData using the
InAppUtils.receiptData
function.Add Get Full App button for purchasing in-app premium content using the
InAppUtils.loadProducts
&InAppUtils.purchaseProduct
functions.Add Restore Purchase button for manually restoring previous in-app purchase using the
InAppUtils.restorePurchases
function.I'm confused what the
receiptData
actually contains? Does it contain ALL receipts from ALL the apps from the logged-in user? Or just the receipts from my app?If I would just use this as a check for the in-app purchase, it will always enable the premium content:
With the
InAppUtils.restorePurchases
function you CAN check if the current purchases contain your in-app purchase, but that requires logging in to your AppStore account everytime/most of the time, so not ideal for step 1 of my workflow.So my question is, how should I validate the receiptData? I don't have a server for my app.
I found this module for validating receipts, but I can't get it working yet with
rn-nodify
.Any help is appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: