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

latest_reciept_info not available #23

Open
MeiyappanKannappa opened this issue Oct 11, 2018 · 3 comments
Open

latest_reciept_info not available #23

MeiyappanKannappa opened this issue Oct 11, 2018 · 3 comments

Comments

@MeiyappanKannappa
Copy link

MeiyappanKannappa commented Oct 11, 2018

Hi,

I have a iap subscription which is autorenewable. I validate the receipt based on availablity of the latest_receipt_info field in validate data and expires_date in that. I tried to validate like

validationData['latest_receipt_info'][0].expires_date > today

This works absolutely fine in sandbox and in testflight app version.

But the same code fails in production. I really cannot understand why. In production i purchase auto renewable subscription, and when i try to validate using below, it throws unable to evaluate validationData['latest_receipt_info'][0].expires_date.

if( !validationData['latest_receipt_info'] || 
                (!validationData['latest_receipt_info'].expires_date && 
                !validationData['latest_receipt_info'][0].expires_date) ){
               // DO PAYMENT
            }else{
                if(validationData['latest_receipt_info'][0] && validationData['latest_receipt_info'][0].expires_date && 
                validationData['latest_receipt_info'][0].expires_date < today ){
                    // DO PAYMENT
                }else if(validationData['latest_receipt_info'] && validationData['latest_receipt_info'].expires_date && 
                validationData['latest_receipt_info'].expires_date < today){
                    // DO PAYMENT
                }else{
                    // NAVIGATE TO PREMIUM SUBSCRIPTION PAGE
                }
            }

Could you please help.

@clementinoux
Copy link

@MeiyappanKannappa did you find an answer?

@MeiyappanKannappa
Copy link
Author

I started validating at the backend without library dependency.

@ssac
Copy link

ssac commented Sep 3, 2020

Did you switch the validation method to production mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants