Rejected: IAP works for beta testers, not for Apple reviewers

I’ve run into a problem with the IAP on an app of mine that is preventing me from passing App Store review. All of my in app purchase products work flawlessly for me and my beta testers, however some (but not all) of the IAP is failing for Apple’s review staff. I am fairly certain that it is not a flaw in my code because a binary I built in mid-October was approved for sale by Apple, and I have made no changes to my IAP since then.

I believe this is related to the new Apple IAP plugin. The build that was approved was built with Corona 2019.3476 targeting iOS SDK 12.1 before I activated the plugin. Builds made after I activated the plugin, both with Corona 2019.3476 targeting iOS SDK 12.1 and with Corona 3555 targeting 13.2 have been rejected by the App Store.

In this post vlads mentioned that with the new IAP plugin has “…very long lag issues…” and I believe this is triggering a timeout. Unfortunately, I have no particular was of verifying this. The error message being reported is “Transaction failed. No response from App Store”, which is the generic IAP Badger response. However, I know that, in general, responses from the app store are being received, since some transactions work for the tester and I can see from that screenshot that was provided that the localized product catalog is being loaded and localized price information is being displayed for all of the IAP. (Not to mention the fact that everything works fine for me and my beta testers.)
One thing I’d be curious to try is doing a build with 3476 targeting 12.1 with the new Apple IAP plugin deactivated, but I don’t know how I’d accomplish that, since it is not called in build.settings- apparently it’s either there or it isn’t, as dictated by my Corona account.

If anyone has any insight into this issue, I’d very much appreciate it.

I would suggest trying latest build which targets iOS13.2, but no ideas otherwise. IAP plugin should not give different results than built-in IAP functionality, unless you want receipts. IAP plugin only provides additional receipt handling funcitonality, repeating core functions.

vlads,

The first binary that was rejected was build 3555 targeting iOS 13.2.

Would it be possible to turn the Apple IAP plugin off on my account? I’d like to try submitting a build without it and see if that works.

IAP plugin is not getting linked if you do not include it in build.settings.

The documentation for the Apple IAP plugin does not have any instructions regarding Project Settings. Previously, there were no plugins to activate for iOS in-app purchasing, and Rob described the new plugin as a “drop in replacement”, which led me to believe that, like the prior incarnation of Apple IAP, it was just integrated into the build automatically.

Perhaps the problem is that I think I’m using it, but I’m not. How should it be activated in build.settings?

Sorry. For plugin you have to include it in build settings, and require it. I’m certain of it:

settings = {     plugins =     {         ["plugin.apple.iap"] = { publisherId = "com.coronalabs" },         ["plugin.apple.iap.helper"] = { publisherId = "com.coronalabs" },     } }

Then in Lua to use it you have to

local store = require "plugin.apple.iap"

 

vlads,

Thank you for the clarification.

Now I run into the problem that I use IAP Badger, so nowhere in my code do I have a [store = …] statement- it’s all handled behind the scenes. Does anyone using IAP Badger have any experience with integrating the new Apple IAP plugin?

vlads,

I copied and pasted the two relevant lines of code into my build.settings file and built to device. Unfortunately, the app crashes as soon as

local store = require "plugin.apple.iap"

is called. There is no runtime error, and the device syslog through the Corona Console doesn’t tell me anything that appears useful- the app just closes. When I comment the new plugins out of build.settings and change back to calling the Store as usual, everything works fine.

Suggestions?

We have the same problem  :( What to do?

Same problem like in “App is crashing” or in App gets rejected? What is specific message it is getting rejected with? I just tried building my sample app and it worked perfectly.

Note, you would have to open main.lua and edit prodList contents to have your IAPs.

Guideline 2.1 - Performance - App Completeness

We found that your in-app purchase products exhibited one or more bugs when reviewed on iPad running iOS 13.2.3 on Wi-Fi.

Specifically, while the in-app purchases are responsive, we received an error message when we attempted to take action on your in-app purchases.

Next Steps

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code “Sandbox receipt used in production,” you should validate against the test environment instead.

Resources

You can learn more about testing in-app purchase products in your development sandbox environment in App Store Connect Developer Help.

For more information on receipt validation, please see What url should I use to verify my receipt? in the In-App Purchase FAQ.

Learn how to generate a receipt validation code in App Store Connect Developer Help.

Please see attached screenshot for details.

Did you understand what the problem is? We cannot pass Apple check for a week.

I don’t really understand what the problem is. Reviewer say that IAP is going good, but they get an error after it was processed. I do not know what do you do when IAP succeeds. My response was to the person who gets crash after calling require "plugin.apple.iap".

Unfortunately I don’t have enough information to tell you what is going on there. Test how your app reacts to IAP and send to review again.

This problem is definitely not “solved,” but, for the moment, I’d call it “mitigated.”

Thanks to GamingStudio17’s advice here, I resubmitted my app, without the new plugin, using Corona 2019.3476 and targeting iOS 12.1. (This combo had failed to pass App Review last week.) The special sauce seems to have been my stating in the rejection response, "This app was built using Corona SDK. It appears that some developers are experiencing a problem where receipts are verified correctly in production, but fail in the sandbox. Could you please provide me with an error log so I can better understand what’s going wrong?"

I have no idea what goes on inside App Review at Apple. My speculation is that the tester read the comment, tried the IAP in production mode instead of in the sandbox, verified that it worked and approved the app for sale.

As for “plugin.apple.iap”, I presume that the reason it doesn’t work for me is because of some conflict with another plugin. I’ll take the time to sort it out eventually, and if I figure it out, I’ll report back.

This is extremely confusing. Our plugin does NOT do any receipt verification. It has APIs to retrieve receipts. Check if you are using any third party tools to verify receipts. Only new plugin has some instruments for receipt validation inside “plugin.apple.iap.helper”.

P.S. I also don’t know why it crashes,  [member=’ colinmorgan’], can you try sample I sent? If it still crashes, can you add?

["plugin.openssl"] = { publisherId = "com.coronalabs" },

 

 

vlads,

I have no idea what goes on under the hood in Apple IAP. I corresponded briefly with a gentleman in Apple’s Developer Technical Support department who speculated that my app was not verifying the receipts properly and pointed me here.

My understanding of what’s been going on is based on reading forum posts about the problems that people have been having with Apple IAP recently. Here’s what I understand based on following various threads:

  • Something changed when Apple release iOS 13
  • Rob mentioned that there was some Slack discussion about a change in the receipt format
  • Purchases made on devices running iOS 9 started crashing apps
  • “plugin.apple.iap” was released to remedy this problem

My speculation is that something changed in iOS 13.2 (and the accompanying update to Xcode), and that it perhaps has something to do with the sandbox. This is based solely on the fact that a build I submitted for review two days before iOS 13.2 passed, and the build I submitted two weeks later failed, despite the fact that, for me, IAP was still working fine. GamingStudio17 began having a similar-sounding problem at around the same time, which lends support to my idea, but it’s only two data points, so it’s not very convincing. We both could have simply been unlucky and the fact that we both passed AR when we sent along a note saying, “This app was built with Corona,” could have been complete coincidence.

Again: I don’t understand what happens in App Review and I don’t understand how Apple IAP works behind Corona’s abstraction.

To answer your questions:

  • I use IAP Badger and that’s it.
  • I’ve downloaded your sample app, but I haven’t had a chance to run it yet. I’ll try to get to it next week.

Thank you for your attention to this problem. I hope that we can figure out what is/was going on, but for the time being I’m just happy that my update is approved and that I can turn my attention to other priorities.

Sincerely,

Colin.

We managed to get through the review of apple with the game Draw Rider. For this, we used the stable version of CoronaSDK 2018.3326 and the latest xcode 11.2.1. The game does not pass the apple review if you build the game in Corona 2019.3559. It is necessary to solve this problem, in the stable version everything is fine. Thanks!

Just to be clear this is a top priority issue for us here. But it is impossible to solve it without understanding of what is going on. I tried to figure out what is causing issues but without any success of even reproducing the issue, or, even understanding what is causing reviewers to flag apps.

Unfortunately, I can’t reproduce the errors either, and the App Review staff weren’t terribly specific with their descriptions of the failure. (Did it happen before or after they’d been asked to confirm their purchase, for example.)

As an end user of Corona, it’s very hard for me to help diagnose this problem. When the guy at Developer Technical Support asked me which URL I was using to verify app receipts in the sandbox, I had no answer: I barely understood the question.

Receipt verification is additional step you can take to ensure that purchases are genuine. When user makes a purchase, receipt is generated by Apple. Then you can send it to your servers, and ask apple if this is a genuine receipt. We don’t do any of that in our IAP plugins, and I don’t think IAP Badger does either (but I can’t give 100%, not our plugin). So this is extremely confusing, since we are not doing any receipt verification, therefore we don’t have any of the URL.