Invalid transaction receipt returned by appStoreReceiptURL (NSData), in iOS 7

后端 未结 1 523
[愿得一人]
[愿得一人] 2020-12-11 18:49

I\'m using following method to get the receipt data:

// Use this method instead of accessing transaction.transactionReceipt directly!
- (NSData *)appStoreRec         


        
相关标签:
1条回答
  • 2020-12-11 19:26

    iOS 7 has changed how receipt validation is done. I went through the exact path you're down and got the same results. What I found was that the receipt from [[NSBundle mainBundle] appStoreReceiptURL] requires a different method for decoding than the previous transaction.transactionReceipt.

    Here is a snippet from Apple's docs:

    The outermost portion is a PKCS #7 container, as defined by RFC 2315, with its payload encoded using ASN.1 (Abstract Syntax Notation One), as defined by ITU-T X.690. The payload is composed of a set of receipt attributes. Each receipt attribute contains a type, a version, and a value.

    If you're looking for a quick fix, I've seen success here: https://github.com/rmaddy/VerifyStoreReceiptiOS

    0 讨论(0)
提交回复
热议问题