Search Unity

In Testflight, always get Purchase Failure Reason : Unknown

Discussion in 'Unity IAP' started by eggtart, Apr 14, 2020.

  1. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    I have a simple project just to test out Unity IAP. I have all the agreements, tax, and bank account setup. And everything seems to work fine when I test the app through XCode using sandbox testers.

    When I tried to test the app through Test Flight, the purchase button will first ask for the password. Once I have it entered and press Buy, I will receive the PurchaseFailureReason: Unknown message. I don't even see the box, saying you are a beta tester and hence the purchase is free, blah blah blah.

    Any advice on why the purchase cannot go through? I have looked everywhere and still don't have a clue.

    I am using the IAP button but handle the callback using the IAP listener. Codeless IAP is properly initialized as I can get the price from the appstore.

    I am using
    Mac
    Unity 2019.3
    IAP 1.23.1

    Thank you very much!
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Did you modify the Codeless code? You said you use the IAP button "but handle the callback using the IAP listener". And you mention "seems to work fine", does it work or does not?
     
  3. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    I have not modified the codeless code. I am using the IAP button to initiate the purchase, and the IAP Listener to handle the success and failure callbacks. This setup works when testing using Xcode and sandbox testers. But when the same app is tested through Testflight, it will always return PurchaseFailureReason:Unknown.

    P.S. One more thing that I should mention is that I have 4 Testflight testers. And one did manage to go through the purchasing process, the rest all got the same Unknown error.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please show your productIDs as defined in your app and on Apple. What TestFlight user are you using? Not sure, but I've heard that Apple recently changed the policy and you can't use your dev account. If you want to direct message me, I'll provide my TestFlight email address and I'll give it a try.
     
  5. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    The productID is "unityiap_weapon" on both. All TestFlight users are AppleStore Connect users.

    "can't use dev account" - what do you mean by that?

    Thanks!
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide the requested screenshots. I meant your own developer account, the one you use on your Apple dashboard.
     
  7. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
  8. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
  9. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    Thanks, but that does not work.

    I have around 5 Testflight testers testing the app. Some managed to get through the purchasing process without any issue, and some will get the Unknown error.

    I found that those who can get through will have a sandbox account created in iTunes and App Store with the same id as the id they are using on their device. Those who got the Unknown error didn't have any sandbox account created.

    So I am guessing for some reasons Apple fails to create the sandbox account and subsequently leads to the Unknown error.
     
  10. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Please try to add a sandbox account in iTunes and App Store.
     
  11. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    For those who are getting the Unknown error, they cannot sign in the sandbox account with their Apple ID. After entering their id and password, nothing will happen. For those who can purchase, they can just signin no problem. Very strange.
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you adding them to TestFlight, or as a member of your Developer team. There is a difference. I never received the TestFlight invite, only the invite to your organization.
     
  13. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    All of them are added to TestFlight as Apple Connect Users, so they will need to join my team first.

    On the other hand, I am adding you as an external tester, which means I would need to have my build reviewed first (which unfortunately is still in progress).

    Or am I getting it all wrong??
     
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, the build needs to be reviewed first or you'll get the Unknown error. Test users need not join your development team (and probably shouldn't! You offered me full access. Someone with full access could delete everything)
     
  15. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    The submission just got rejected because the inapp purchase part is not working.... The reviewer is also getting the Unknown error and considered the app has bug.
     
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You are not trying to publish live to the App Store, right? Does it work for you in your testing? If it doesn't work for you, it won't work for the App Store reviewers. You need to be following the development and publish flow as described here https://docs.unity3d.com/Manual/UnityIAPAppleConfiguration.html
     
  17. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    Not live, just beta review. Have to go through beta review in order to send the app to external TestFlight testers.

    External Testers and Groups
    Invite up to 10,000 external testers using their email address or by enabling and sharing a public link, which creates an open invitation for anyone to test your app. Simply create a group of testers and add the builds you’d like them to test. You can also create multiple groups and add different builds to each one, depending on which features you want them to focus on. When you add the first build of your app to a group, the build gets sent to beta app review to make sure it follows the App Store Review Guidelines. This is the only beta version of your app that requires a full review, and testing can begin once it’s approved.
     
  18. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Don't use external testing.
     
  19. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    Apple approved the build after I explained to them the issue I am facing. Amazing!
     
  20. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    And my TestFlight build just started to work! I was able to do a test purchase.
     
    ilmario likes this.
  21. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    That is the strangest part. The reviewer could not get it to work (that's why he rejected the build in the first place). And I am still getting the Unknown error.
     
  22. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you getting the "Enter your Sandbox credentials" when you attempt to purchase? Are you installing directly to your iPhone via XCode, that is how I test, there is no need to publish. Please see the previous link and confirm that you are following all the steps https://docs.unity3d.com/Manual/UnityIAPAppleConfiguration.html
     
  23. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    Not getting the sandbox popup, as I am testing with other apple ids through Testflight, so am using the "real" apple ids. So are the other Testflight testers, none of them are installing directly from xcode. Btw, testing through sandbox is ok from day 1.

    And yes, have followed all the steps in the link.
     
  24. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    When you get the TestFlight invite in email, you must Accept it on the device and click "View in TestFlight"
     
  25. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    Yes, of course. That's what all my testers are doing, accept the invite and receive the build through testflight.
     
  26. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If they already installed and tested before approval, you may need to create a new release for them. I accepted, after the approval. But you don't need to go through TestFlight, you can Build and Run from Unity --> XCode -> your iOS device.
     
  27. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    "But you don't need to go through TestFlight, you can Build and Run from Unity --> XCode -> your iOS device." - that is testing locally using sandbox tester accounts created in apple connect. There is no issue with that, the app works perfectly the first time if tested this way. It is only when testing through Testflight that we see this happening, some ok and some not ok (which unfortunately includes the Apple reviewer).
     
  28. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Understood, let me know regarding my last suggestion, might need a new build. It's working for me! And I installed after the approval, may make a difference. But I would highly suggest not doing External Testing for an IAP app.
     
  29. eggtart

    eggtart

    Joined:
    Feb 4, 2013
    Posts:
    46
    So far 5 Users have tested the same beta approved build through testflight
    3 are ok (using iOS 13.4.1, 13.4, 13.3.1)
    2 are not ok (using IOS 12, 13.3.1)
     
  30. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Check with Apple