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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Consistent PurchaseFailureReason.Unknown result on specific iOS devices

Discussion in 'Unity IAP' started by AbeGellis, Aug 3, 2018.

  1. AbeGellis

    AbeGellis

    Joined:
    Dec 16, 2016
    Posts:
    7
    I'm currently preparing an app with an auto-renewing subscription product for its initial App Store release. I have configured my project and product to support the subscription and can reliably perform sandbox purchases on most of our test devices (both iPhones and iPads).

    However, when I attempt to test the purchase on one specific device (a 64gb iPhone 8) or an iOS simulator, the purchase fails. Unity IAP (version 1.20) initializes correctly (at least for the product ID I am attempting to purchase; other product IDs that I haven't started supporting fail as expected) and retrieves the price of the product, but attempting to initiate the purchase fails with PurchaseFailureReason.Unknown. The accounts used to purchase on both devices are sandbox testers and have been used for successful sandbox purchases on other devices.

    When I connect Xcode to either the simulator or the problem iPhone, I see the following logs right before OnPurchaseFailed gets called:

    UnityIAP: PurchaseFailed: 0
    onPurchaseFailedEvent({0}): [my product name] UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription) UnityEngine.Purchasing.JSONStore:OnPurchaseFailed(PurchaseFailureDescription, String) UnityEngine.Purchasing.Extension.UnityUtil:Update()

    I haven't been able to find any information as to what the 0 error code might correspond to.

    I'm unsure of what the issue is, and I'm concerned that this may affect an unknown number of potential subscribers when we formally launch the app. I've seen some ambiguous complaints around iOS 11.2 sandbox IAP (which several test devices, including the problem iPhone and Simulator, are currently using) but I'm not sure if this will go away in the live store.
     
  2. AbeGellis

    AbeGellis

    Joined:
    Dec 16, 2016
    Posts:
    7
    Restarting the problem iPhone seems to have allowed it to upgrade, but if anyone has any insight as to the initial cause of this issue I'd like to know - that isn't a sufficient workaround for the live app if random users will still see "upgrade failed".
     
  3. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you elaborate on the "Upgrade failed" message that you are receiving, can you provide the exact error text? What upgrade are you referring to, perhaps upgrading a 1 week subscription to a 1 month subscription or similar? Do other purchases on this device work (at the time), or is it just the subscription that is (was) failing?
     
  4. AbeGellis

    AbeGellis

    Joined:
    Dec 16, 2016
    Posts:
    7
    Where would I go to find the error text? My IStoreListener is getting the PurchaseFailureReason.Unknown result which I can see in a debug statement I put in the OnPurchaseFailed implementation.

    It's a 1-month subscription, which in the sandbox should correspond to a 5-minute subscription.

    I haven't tested other purchases - this subscription is the only one for this particular app, and we don't have any other apps with purchases in TestFlight right now. We didn't test other apps on that device before restarting it.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I meant the "Upgrade failed" message. What are you upgrading?
     
  6. AbeGellis

    AbeGellis

    Joined:
    Dec 16, 2016
    Posts:
    7
    Oh, sorry - the subscription is for an upgraded, complete version of the product. "Upgrade failed" is the message I display when the IStoreListener gets OnPurchaseFailed.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it! Unfortunately it would not be possible to troubleshoot after the fact without guessing. If you can reliably reproduce, we would be most interested. If the device didn't have network connectivity or if the user wasn't logged in or similar, it could return this message.