Search Unity

Latest Unity IAP throws an Exception when invoking RestorePurchases on UWP?

Discussion in 'Unity IAP' started by skullthug, Feb 21, 2021.

Thread Status:
Not open for further replies.
  1. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    202
    I've already reported this via a support ticket here, but due to the urgent nature (and for anyone else's benefit if they are googling this) I'm crossposting it here.

    We are attempting to emergency update our product in the Microsoft Store, as the Unity IAP oddly stopped working out of nowhere. (Debugging a live version has been very difficult so we have no real idea yet, but based on our custom errors the store seems to possibly fail to initialize properly).

    Anyways, figured the best place to start would be to update to latest Unity IAP (both packages). So we are at 2.2.7 in the Plugin side, and 2.2.2 on the Package Manager side. In Unity 2018.4.26f1.

    While testing out the newest Unity IAP, we've run into an Exception that now gets thrown, when attempting to invoke via IExtensionProvider.GetExtension<IMicrosoftExtensions>().RestoreTransactions().

    Regular IAP purchasing with the mockbillingsytem set to enabled appears to work as expected (it brings up the debug IAP menu we're used to), and the purchasing system is properly initialized when we hit this Exception, so we're beginning to suspect this might be a UnityIAP bug.

    We'll continue to investigate while we wait to hear back from Unity, but in the meantime I wanted to get some input possibly on this b/c we are trying to fix this ASAP, as users are not able to purchase anything in our live app at the moment.

    Error output from the Visual Studio console follows:

     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @skullthug We received your support request and looking into it. If we can find the issue, any fix would go into a future release. This should not affect initialization though, and is likely a separate issue. As mentioned in the support ticket, remove the restore logic as a test to confirm.
     
  3. aart

    aart

    Joined:
    Dec 17, 2014
    Posts:
    1
    Also at 2.2.7 on the Plugin side, and 2.2.2 on the Package Manager side. In Unity 2020.2.6f1.
    In app purchases fail to initialize after invoking
    Code (CSharp):
    1. UnityPurchasing.Initialize
    with error:
    Code (CSharp):
    1. UnityIAPWin8:pollForProducts() Exception (persistent = False, delay = 0, retry = 30), exception: Exception of type 'System.Exception'
    Steps to reproduce: follow the 4 year old documentation at https://docs.unity3d.com/Manual/UnityIAPWindowsConfiguration.html
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Separate (but valid) issue. This thread is discussing RestoreTransactions callback when using the mockBilling flag during testing (which is a low priority issue and not likely to be addressed soon)
     
Thread Status:
Not open for further replies.