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

Unable to validate receipt in ios Production. Sandbox and Testflight is fine #198

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

Comments

@MeiyappanKannappa
Copy link

MeiyappanKannappa commented Oct 11, 2018

Hi,

I have a iap subscription which is autorenewable. I validate the receipt using sibelius/iap-receipt-validator based on availability 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

Any news?

@waheedakhter
Copy link

@MeiyappanKannappa were you able to fix the issue? What was the fix?

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