Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Test in-app purchase inconsistent on iOS devices

Discussion in 'Unity IAP' started by treborguy, Jun 22, 2020.

  1. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    Hi there,

    My in app purchases are working on some of my testers' devices but not on others. It also works fine on my iOS device and all Android devices.

    I have 2 users who have tried dozens of times with different builds. I even switched from completely code based in app purchases to codeless and it's still just an issue for those specific users.

    I have confirmed that purchasing is initializing for them, and that the product exists. After they put in their password the purchase always fails with the error message: "OnPurchaseFailed: FAIL. PurchaseFailureReason: Unknown"

    And that's the only information I about the problem that I can get. Again, it works fine for some of my users, and others not at all.

    Maybe someone could give me some suggestion of what to do. Right now I'm using the Codeless API so there should be no issue with my code.

    As for the IAP catalog these are the steps I have taken:

    • Set ID to IAP name on App Store Connect and Play Console

    • Set type to non-consumable

    • Selected English (U.S.) (Google Play, Apple)

    • Given Title

    • Given Description

    • Given pricing template for Google

    • Set price tier for Apple

    • Set screenshot path

    • Set Apple SKU

    • Set Apple Team ID
    As mentioned, the button is hooked up and working on some iOS devices and all Android devices, so I don't think it's anything to do with how I've configured IAP in Unity.

    Any suggestions would be greatly appreciated!

    I'm also now getting a problem with Codeless IAP where if you cancel the in app purchase and go to purchase again, the button doesn't bring up the test confirmation dialogue, or the option to enter your password on the device. (But it DOES trigger BuyProductID() still)

    Thanks Rob
     
  2. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    Anyone?

    Again, In app purchases work on some iOS devices not others.
    Upgrading to Codeless IAP did nothing, except break the dialogue. Now if I hit "cancel" and try the purchase again, nothing happens.

    Please help I've been stuck on this for 3 days!
     
  3. xLeo

    xLeo

    Joined:
    Sep 21, 2010
    Posts:
    177
    We had some reports related to this issue and couldn't figure out what happened.

    It may be some issue when communicating with Apple's servers, but that's just a hypothesis. It would be nice to have some feedback from Unity team regarding some common causes for the "Unknown" error.

    Bonus question: why do some purchases take forever to initialize on iOS? We have to use in-app loading screens to handle that.
     
  4. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    That's great to know xLeo! Glad it's not just something happening to me.

    Yeah! I'm also getting the massive initialization time on iOS

    I also just got this from one of my users, which is not something they had seen so far. Perhaps there's something wrong with Apple's servers, but all the status checks are green https://www.apple.com/support/systemstatus/

     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    This has the appearance of an issue on the Apple servers, Unity IAP is just a wrapper for their StoreKit API
     
  6. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    Thanks for the info. I'm just surprised I'm not reading about more issues like this, it's not been working for the last 3 days for some of my users.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I assume they have tried restarting their phone and confirm they are logged into and able to launch the App Store? What about auth method, fingerprint or facial ID perhaps?
     
  8. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    Yes they have tried a few things:

    - They're both logged in to the app store
    - They've restarted their phones
    - Uninstalled the app and reinstalling
    - Switched from WiFi to phone internet and vice versa

    Who knows! Maybe now that they're getting this server message that means that I fixed something, and it has nothing to do with the past 3 days of problems...

    Would love any other suggestions though, even wild suggestions
     
  9. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    And yes they're just using standard apple passwords
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    And what version of iOS?
     
  11. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    One hasn't got back to me but the one who got that error message has the latest version - 13.5.1
     
  12. xLeo

    xLeo

    Joined:
    Sep 21, 2010
    Posts:
    177
    Extra information: we have been receiving reports about this since around March/COVID quarantine.
    It may be a coincidence though, or not.

    @JeffDUnity3D Why is iOS purchasing process so slow? It is a question that I have since Unity IAP has been first released but never actually asked anyone.
     
  13. treborguy

    treborguy

    Joined:
    Apr 17, 2014
    Posts:
    30
    Hmm! So basically it's probably a known issue on Apple's end? Can't think how much money this bug could be costing them...

    And to add to @xLeo 's question, is it just an issue with test purchases?

    Thanks guys!
     
  14. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I just updated my phone to 13.5.1 and started seeing the Sandbox password verification error too. Let's hope it's in their Sandbox only.
     
  15. xLeo

    xLeo

    Joined:
    Sep 21, 2010
    Posts:
    177
    Some users (friends/family) reported that issue to us on Sandbox builds as well.
    I also hope it just happens on Sandbox (maybe slower/unreliable servers..).

    Another question that is bothering me for a while: What's the best way to check if an iOS/Android purchase was made in Sandbox/test mode? I know that it's possible by performing an online check with the receipt, but I don't know how to that using Unity Purchasing API (and neither how to get the original receipt data).
     
  16. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Not that I'm aware of.