Search Unity

iOS App got rejected

Discussion in 'Unity IAP' started by stefanob, May 15, 2019.

  1. stefanob

    stefanob

    Joined:
    Nov 26, 2012
    Posts:
    68
    Hello,

    I submitted an iOS App where you can purchase the full game (first ten levels are free) and it got rejected with the following message:


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

    When we attempted to purchase the full game, the activity indicator spun indefinitely and no purchase was triggered.

    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."



    So far I don't use receipt validation and it is not mandatory right?
    Does the message mean the only problem is that I don't handle the failed purchase properly or do I really have to test against production/test environment somehow? If so I wouldn't now how to do that.

    Or is it enough for me to just hide the spinner and not unlock the full game if the purchase fails?

    Thanks!
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. stefanob

    stefanob

    Joined:
    Nov 26, 2012
    Posts:
    68
    Thanks for the quick reply.

    Everything works fine on Testflight. I can purchase the full game in Sandbox environment.
    Actually I was not handling the OnPurchaseFail properly. That's why the spinner stayed. Fixing this is not a problem. I was just wondering if Apple expects me to handle it in a certain way or if it is okay to just hide the spinner and not unlock the full game.

    "If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead."

    I wouldn't know how to validate against the test environment.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please refer to the documentation link earlier for instructions on testing in TestFlight. If purchase fails, you obviously don't want to unlock the product. Could be an invalid credit card or any number of reasons.
     
  5. stefanob

    stefanob

    Joined:
    Nov 26, 2012
    Posts:
    68
    Thank you, it looks like I just had to handle the OnPurchaseFailed properly. The app got accepted now.
     
  6. tmeans825

    tmeans825

    Joined:
    Mar 10, 2015
    Posts:
    3
    When you say properly, what exactly did you do to get it to work? I'm running into the same issue.
     
  7. stefanob

    stefanob

    Joined:
    Nov 26, 2012
    Posts:
    68
    In my case if someone starts the purchasing process I show a loading spinner in the background. If the purchase failed for any reason I didn't hide the spinner and you could not continue playing. That was the reason why it got rejected.
     
  8. goldmark

    goldmark

    Joined:
    Jul 23, 2019
    Posts:
    17
    I am getting the same problem (Apple rejected, stuck with infinite spinner trying to purchase). IOS 12.4, Ipad on wifi.

    I think I handle the failed purchase properly. In the fake store (in the editor) I get the CodelessIAPStoreListener::OnPurchaseFailed, which calls IAPButton::OnPurchaseFailed which calls my function, which removes the spinner and reports the failure to the user.

    I tested with test users on the device as well, with the same result. If for example I disable wifi, I will get a failure, and if I enable it, purchase completes. But for some reason Apple review is getting the infinite spinner, which means my code neither gets a fail nor success.

    What could be causing this?
    Thanks
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We have no control over your app behavior, or the Apple review process. Have you tested on TestFlight with an invalid purchase attempt?
     
    pKallv likes this.