IAP not working correctly with Corona-2019.3528 and IOS 13

We have noticed a problem with Build Corona-2019.3528 on IOS 13 with XCode 11.0 .

After the payment gone through when the purchased state is triggered in the listener, the receipt from the transaction is broken. We are using the standart store implementation.

On IOS 12 the same version is working. Also are versions wtih older Corona versions and an older XCode Version working fine.

Can you provide more information?

what tells you the receipt from the transaction is broken?

What do you mean by standard store implementation? Almost everyone implements IAP slightly differently.

Any log information, screenshots, etc. showing the issue would be very helpful.

Rob

We are sending the receipt base64-encoded to our Backend for validation.

Sandbox-Receipt with IOS 12

{
    “signature” = “A2zQ3dj/+Cj+ik660Ek+U3vzlkGIz/K/S+V3EUq+L+SENrWrVg77ldLCZzJmpo7EoFPl5WyNtz78M7zU+6zkHNu5+cN5NUO6xszbO00iUk0Qf7uWdtlvC+Dj/cBjmCUn0ctzyNM+3JffMIKLi14XIobj9TWWOkkSfv0ec63z1OBxvPtATWJyTep7prgmmb+R6XDxnVIif+OdM3p5/KKjlq8BhVlZnIBxq9h2hP+D74b8/lwQ6/0SsJYQ/D/G5/+819QfRhSmISQGaUP1lcnc6mtd5ZPXafMVP1cmvYOYhOt0oBT1kuEKN5iR8zqOKNIRXAu9DUxT6lTC3AusRiZTSPMAAAWAMIIFfDCCBGSgAwIBAgIIDutXh+eeCY0wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTUxMTEzMDIxNTA5WhcNMjMwMjA3MjE0ODQ3WjCBiTE3MDUGA1UEAwwuTWFjIEFwcCBTdG9yZSBhbmQgaVR1bmVzIFN0b3JlIFJlY2VpcHQgU2lnbmluZzEsMCoGA1UECwwjQXBwbGUgV29ybGR3a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aW9uLWV4dGVybmFsLWlkZW50aWZpZXIiID0gIjAiOwoJImlzLWluLWludHJvLW9mZmVyLXBlcmlvZCIgPSAiZmFsc2UiOwoJInB1cmNoYXNlLWRhdGUtbXMiID0gIjE1NjkyNDgzMTU4NjYiOwoJInB1cmNoYXNlLWRhdGUiID0gIjIwMTktMDktMjMgMTQ6MTg6MzUgRXRjL0dNVCI7CgkiaXMtdHJpYWwtcGVyaW9kIiA9ICJmYWxzZSI7Cgkib3JpZ2luYWwtcHVyY2hhc2UtZGF0ZSIgPSAiMjAxOS0wOS0yMyAxNDoxODozNSBFdGMvR01UIjsKCSJiaWQiID0gImNvbS53aG93LmphY2twb3QiOwoJInB1cmNoYXNlLWRhdGUtcHN0IiA9ICIyMDE5LTA5LTIzIDA3OjE4OjM1IEFtZXJpY2EvTG9zX0FuZ2VsZXMiOwp9”;
    “environment” = “Sandbox”;
    “pod” = “100”;
    “signing-status” = “0”;
}

Sandbox-Receipt with IOS 13

C{
    “signature” =##

This broken receipt leads to the error “Payment not verified. Status 21002. Message: The data in the receipt-data property was malformed” from Apple.

With standard store implemtation we mean the store=require(“store”) and not the plugin store=require(“plugin.apple.iap”) implementation.

Forwarded to Engineering.

Rob

I’m having what I think is a different flavor of the same problem.

On older iOS devices (v 9.3.5), IAP transactions crash the app on the latest version of my app, built with 2019.3531, but work fine on the previous version of my app, built last month with 2019.3504. The crash seems to happen at the point when the app has received a reply from Apple’s servers.

I also experience a crash when attempting to restore purchases.

IAP transactions work fine on devices running iOS 12 and 13. (I don’t know about iOS 10 and 11, since I don’t have any test devices that use that version of the OS.)

I’d attach a crash log if I could, but, even though I’m watching the crashes happen in Console, the report is not showing up where it is supposedly being saved.

There is a discussion on the community Slack about this. When I test it, I get something like:

{length = 3478, bytes = 0x7b0a0922 7369676e 61747572 6522203d … 3d202230 223b0a7d }

when I print the transaction.receipt to the console.  

The developer reporting this on Slack has gone back to some older builds that he knows worked before so apparently Apple has changed how the receipt is formatted. It’s possible that it’s a hex encoded byte array that contains a JSON structure inside it.

I’ll post more once I learn more.

Rob

Is this something which has an impact on IAPs in older games which are already in the store for some time?

Any news on the problem?

Shouldn’t.

After this issue was reported, I put out an update of my app that I built with Corona 2019.3476 targeting iOS SDK 12.1 and it works fine: No problem with App Store review, no customer complaints and plenty of successful transactions.

any update on this?

Do you have any update? This still doesn’t work.

There is an Apple IAP in the Marketplace that will handle the new receipts. 

Rob

Who has to update already published apps now?

 We do. The new iap  plugin returns all receipts rather than simply the one just purchased.

What does this mean for apps already published. Is there something “broken” with IAP now or is this for new app builds? Do I have to “fix” old apps in the store or is everything working like before if it already is in the store?

 Apps already on the store will still work. If you update any apps with ios 13 test your purchases.

Thanks for the clarification! Helps a lot! :slight_smile:

So how do we use this plugin?

Just replacing the old one with the one in the marketplace still throws an error on receipt validation.

It should be a drop in replacement.

I just wanted to add a quick bit of followup based on my experience today: In September, after this problem cropped up, I did a build using Corona 2019.3476 targeting iOS SDK 12.1 that worked fine. Today, the same build combo resulted in crashes on purchase on devices running iOS 9. However, after downloading the latest daily build (3545) and activating the new Apple IAP plugin, purchasing on iOS 9 is once again working.

So, if you are using an older version of Corona targeting an older version of the iOS SDK, you might start seeing transaction failures in future builds. Obviously, your mileage may vary.

Also, “Restore Purchases” is still a little crash-prone, but upon relaunch, purchases are successfully restored.

Thank you for getting this taken care of, Team Corona- I appreciate it!

I tried your solution. When trying “restore purchases” the app crashes immediately.
I was using the latest iPad Pro running iPad OS 13.1.3.
Corona version is 2019.3547 and iOS SDK 12.4. There is no error message in device log.
Anyone knows what’s going on?