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

时间秒杀一切 提交于 2019-11-28 13:36:09

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!