Hello,
In one of my apps I have a non-consumable purchase that has worked fine since I published the app last December. But now it suddenly doesn’t work even though it is still the same version in the AppStore. I have tried on several iPhones (installing/uninstalling) and it works on some of them (both 10.3.2 and 10.2.1) but not all. I am using IAP Badger plugin from the Corona Marketplace but according to “Happy Mongoose Games” (who made the plugin), IAP Badger is just a lua wrapper class for Corona’s store libraries and doesn’t handle the detail of interactions with iTunes Connect etc. Below you have:
A. The logs from a device where the failure occurs
B. My original question to Apple support
C. The Answer from Apple support
Any suggestions as to the cause of this error?
A. The logs from a device where the failure occurs
Jun 21 20:42:52 IRD4 itunesstored(iTunesStore)[116] <Notice>: ISDevice: Taking power assertion: com.apple.itunesstored.purchase
Jun 21 20:42:52 IRD4 accountsd(AccountsDaemon)[88] <Notice>: “<private> (<private>) received”
Jun 21 20:42:52 IRD4 itunesstored(Accounts)[116] <Notice>: “The connection to ACDAccountStore was invalidated.”
Jun 21 20:42:52 IRD4 itunesstored(iTunesStore)[116] <Notice>: ISStoreURLOperation: Started request at [519763372.33] for <private>
Jun 21 20:42:52 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC TCP Conn Start [486:0x1091b9b30]
Jun 21 20:42:52 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC TCP Conn Event [486:0x1091b9b30]: 1 Err(0)
Jun 21 20:42:52 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC TCP Conn Connected [486:0x1091b9b30]: Err(0)
Jun 21 20:42:52 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC Enabling TLS [486:0x1091b9b30]
Jun 21 20:42:52 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC TLS Event [486:0x1091b9b30]: 2, Pending(0)
Jun 21 20:42:52 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC TLS Event [486:0x1091b9b30]: 11, Pending(0)
Jun 21 20:42:52 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC TLS Event [486:0x1091b9b30]: 14, Pending(0)
Jun 21 20:42:52 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC TLS Trust Result [486:0x1091b9b30]: 0
Jun 21 20:42:53 IRD4 CommCenter(libATCommandStudioDynamic.dylib)[74] <Notice>: QMI: Svc=0x02(DMS) Req MsgId=0x002f Bin=[<private>]
Jun 21 20:42:53 IRD4 CommCenter(libATCommandStudioDynamic.dylib)[74] <Notice>: QMI: Svc=0x02(DMS) Resp MsgId=0x002f Bin=[<private>]
Jun 21 20:42:53 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC TLS Event [486:0x1091b9b30]: 20, Pending(0)
Jun 21 20:42:53 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC TCP Conn Event [486:0x1091b9b30]: 8 Err(0)
Jun 21 20:42:53 IRD4 itunesstored(CFNetwork)[116] <Notice>: TIC TLS Handshake Complete [486:0x1091b9b30]
Jun 21 20:42:53 IRD4 itunesstored(iTunesStore)[116] <Notice>: ISStoreURLOperation: Received 200 response: [0.93s] <private>
Jun 21 20:42:53 IRD4 itunesstored(iTunesStore)[116] <Notice>: ISStoreURLOperation: Finished loading: [519763373.27, 0.94s] <private>
Jun 21 20:42:53 IRD4 itunesstored[116] <Notice>: PurchaseProtocolDataProvider: Error handler resolved with type: 0
Jun 21 20:42:53 IRD4 itunesstored[116] <Notice>: PurchaseOperation: Purchase failed with code <private>: <private>
Jun 21 20:42:53 IRD4 itunesstored[116] <Notice>: PurchaseOperation: storeCorrelationID: <private>
Jun 21 20:42:53 IRD4 itunesstored(iTunesStore)[116] <Notice>: ISDevice: Releasing power assertion: com.apple.itunesstored.purchase
Jun 21 20:42:53 IRD4 itunesstored[116] <Notice>: [AppReceipt] No receipt data for: <private>
Jun 21 20:42:53 IRD4 itunesstored[116] <Notice>: StoreKitClient: Buy failed with error: <private> for payment: <private>
B. My original question to Apple support
In my app, I have a non-consumable purchase that has worked fine since I published the app last December but now it does not work since I updated my iPhone 6S to 10.3.2. I have tried on several iPhones and it works on some of them (both 10.3.2 and 10.2.1) but not all. I googled the error but the only thing I could find that it may have something to do with the “iOS Trusted Root Certificate”. Please note that I have not changed anything in the app since the time it worked on all devices, the version is still the same.
C. The Answer from Apple support (edited)
The issue sounds like one where the application statically validates the applicationReceipt to determine whether the user has purchased the non-consumable subscription. Does the app do this. Furtheremore, does the app link to it’s own copy of the Apple Trusted Root Certificate? If so, my guess is that this problem is not iOS dependent, but for whatever reason, the app did not get reinstalled from the iTunes Store since last October until you installed (updated) to iOS 10.2. Late last year, the Apple Trusted Certificate used by the iTunes Store to sign applicationReceipts - expired. A new certificate was obtained, and used to sign applicationReceipts. If you never re-installed the app for quite a while, the original applicationReceipt would have remained in the app, and the earlier code would have been able to statically validate the receipt. However at some point, I’m guessing, you reinstalled the app from the App Store, In doing so, the applicationReceipt is now one which is signed with the new certificate - however, it no longer matches the copy in your code, and the app fails to validate the non-renewing subscriptions.
