I'm seeing a very strange thing happening with my application.
To be specific, I am issuing a receipt request in order to download a receipt from Apple when I detect that the application does not contain a receipt file in its bundle.
Sure, calling the receipt refresh API causes the Apple ID login screen to be shown.
I have created "test"/"sandbox" users in iTunes Connect in order to test my application.
When running the application on my device (iPad with WiFi), the app successfully calls the refresh receipt function and then sure enough, the Apple ID login screen pops up. I enter the correct credentials of the test/sandbox user configured in iTunes Connect and everything is fine (i.e., the receipt is downloaded successfully.)
However, if I attempt to use a real Apple ID user, I get "didFailWithError" and the localized error description is: "Cannot connect to iTunes Store", the error code being "16".
This is expected, in my opinion.
Now, the sad part is that when I have submitted my build to Apple Review, they are getting the exact error mentioned above.
They are saying that they are using a sandbox user and thus they have rejected the application as they were unable to continue.
Note: They too have used an iPad with WiFi for testing the application.
I have consistently been able to reproduce this problem only when using real Apple ID user accounts and have never had a problem with sandbox users!
I've read somewhere that one would have to also make sure that the sandbox user is logged out of the "Settings" screen when testing. I've politely asked Apple Review to make sure that they would not be logged into "Settings" when testing.
They have sent me two screenshots: One with the Apple ID login screen that asks for BOTH the Apple ID user and the password (which causes me to think that they indeed were logged out of the "Settings" screen, otherwise they'd already have the Apple ID user pre-populated in the dialog) and one showing the error mentioned in this post.
I have no idea how to proceed now because I simply cannot reproduce this problem. It works perfectly with any sandbox users on my device -- it just doesn't work with real Apple ID users.
Apple Review sent me a screenshot showing the error mentioned in this post, again, an error that I can only reproduce when using a real Apple ID user in what is really a sandbox environment.
I think the only difference may be the fact that my device is running iOS 10.x while their device may be running iOS 12.x but I don't think it should be an issue.
Any thoughts ?
Thanks in advance!
P.S., they are not using an Apple ID sandbox user created by me -- they use their own. I have suggested to send them my sandbox users to test, but they said they could not accept as it would be a breach of privacy.
UPDATE: I have confirmed that the same thing happens on iOS 12.1 so it's not due to an OS difference.
It looks like at least in my case, there seems to be a problem with the refresh receipt API itself.
I have confirmed that initiating a purchase request causes the app to download a receipt from Apple with the credentials of the supplied user (sandbox user in our case.)
The review team has confirmed that the purchase request works correctly with their sandbox user, however, the refresh receipt DOES NOT work with that exact same user (it causes a code 16, "Cannot connect to iTunes Store")!
I have also confirmed that a "Restore" request causes the receipt to be downloaded and that it works with the supplied sandbox user.
In conclusion, both "Purchase" and "Request" operations causes the app to download a receipt from Apple and they work correctly for the sandbox user supplied by the Review Team. However, with the exact same user, the receipt refresh request fails!
I can still ask for a receipt refresh because it should work correctly for actual App Store downloads but it clearly did not work for app review.