tikhop / TPInAppReceipt

Reading and Validating In App Purchase Receipt Locally.
MIT License
636 stars 95 forks source link

Permanent ValidationFailed error #47

Closed CineDev closed 4 years ago

CineDev commented 4 years ago

Platform

Environment

Version

ℹ 2.3.4

Related issues

Report

Issue summary

ℹI get permanent ValidationFailed error. Rolled back to version 2.2 and everything works fine

What did you expect to happen

ℹ expect the validation will be success on apple's MAS receipt

What happened instead

ℹ Please replace this with what happened instead.

tikhop commented 4 years ago

@CineDev could you please provide a failure reason.

CineDev commented 4 years ago

error.localizedDescription contains error code 1. That's all

tikhop commented 4 years ago

@CineDev there should be a reason ValidationFailureReason then I can understand at which stage of validation you get a failure

CineDev commented 4 years ago

I'll try to play around tonight. We'll provide you information as much as I can

tikhop commented 4 years ago

@CineDev Thank you!

tikhop commented 4 years ago

@CineDev you can get a reason by doing next:

do {
    try receipt.verify()
} catch IARError.validationFailed(let reason)
{
    print(reason)
}

Best, P

CineDev commented 4 years ago

signatureValidation(TPInAppReceipt.IARError.SignatureValidationFailureReason.appleIncRootCertificateNotFound)

tikhop commented 4 years ago

@CineDev well, from the README

Note: Currenty, SwiftPM doesn't support the feature of adding resources to package and therefore you have to add the Apple Root Certificate manually. You can find it here.

You need to download Apple Inc Root Cert.

Best, P