tvOS IAPs Authenticate But Purchase not Awarded



  • Except a few missing script references which seem to be related with rewarded videos, I cannot see an issue on the device log. Those should not cause the purchase to not complete. Thank you for posting on the Unity IAP forum - the response so far is a bit underwhelming.

    Double check that:

    • in the IAP Settings for your product, there is no platform override defined for iOS/Mac
    • the IAPListener script on the IAPManager prefab is active
    • in the case of currencies, DBManager.IncreaseFunds is called within the IAPManager script (PurchaseVerified method, line 502)

    As I said, unfortunately I don't have a chance to test this on a device. Still, the difference to iOS is very weird.



  • I don't have time to investigate this morning (EST) but I'll look into in and reply back later today to early tomorrow.

    That said, I'm also having an issue with MacOS standalone which I may post here as well if I don't find a solution in the meantime.



  • It doesn't look like I'm going to get much help from Unity. If you read the linked thread you will see what I mean.

    Maybe you can jump in there as well?



  • That's the standard support from Unity in the IAP section... they usually don't read topics in detail. Totally unrelated responses. But, like I suggested first, running the default Unity IAP sample scene would really point out if there's an issue with Unity IAP, then they have to investigate it. Unfortunately there's nothing else I could add to the discussion at this point.



  • I may have discovered the issue but I haven't been able to test it because of a slew of odd technical difficulties. If I eventually find that the fix works I'll report back here with the solution.



  • Okay so I figured out what was causing the issue. This has nothing to do with building to tvOS.

    When you made your 3 suggestions I was skeptical because I had double checked each one of those previously. In fact, I believe that the issue I was dealing with this week was the same issue that was plaguing me a few weeks ago.

    The IAPListener component was disabled. I did NOT disable this component. In fact, the last time I interacted with it I had enabled it to fix an issue with the iOS/Android build.

    I did not disable this component so I'm a bit dumbfounded as to how this can keep happening. Regardless, thanks for the support.



  • Even with the IAPListener script disabled, users should still be rewarded with products or currency, because the reward is happening in the IAPManager. The IAPListener only displays a UI message to the users to inform about the purchase.

    Did you implement your own reward mechanic into the IAPListener by any chance?

    I will look into the mysterious IAPListener disabling and try to get rid of the OnEnable+OnDisable methods.



  • I did implement the switch that governs the reward mechanic:

    /// <summary>
            /// Handle the completion of purchases, be it for products or virtual currency.
            /// Most of the IAP logic is handled internally already, such as adding products or currency to the inventory.
            /// However, this is the spot for you to implement your custom game logic for instantiating in-game products etc.
            /// </summary>
            public void HandleSuccessfulPurchase(string id)
            {
                if (IAPManager.isDebug) Debug.Log("IAPListener reports: HandleSuccessfulPurchase: " + id);
    
                //differ between ids set in the IAP Settings editor
                switch (id)
                {
                    case ("QT_TR_Cx1000"):
                        DBManager.IncreaseFunds("coins", 1000);
                        ShowMessage("1,000 coins were added to your balance");
                        break;
                    case ("QT_TR_Cx3300"):
                        DBManager.IncreaseFunds("coins", 3300);
                        ShowMessage("3,300 coins were added to your balance");
                        break;
                    case ("QT_TR_Cx6800"):
                        DBManager.IncreaseFunds("coins", 6800);
                        ShowMessage("6,800 coins were added to your balance");
                        break;
                    case ("QT_TR_Cx11500"):
                        DBManager.IncreaseFunds("coins", 11500);
                        ShowMessage("11,500 coins were added to your balance");
                        break;
                    case ("QT_TR_Cx24000"):
                        DBManager.IncreaseFunds("coins", 24000);
                        ShowMessage("24,000 coins were added to your balance");
                        break;
                    case ("QT_TR_Cx62500"):
                        DBManager.IncreaseFunds("coins", 62500);
                        ShowMessage("62,5000 coins were added to your balance");
                        break;
                    default:
                        Debug.LogError(id + " is not a valid case!");
                        break;
                }
            }
    

    This is in the IAPLIstener class. I do believe that this is where this code is supposed to be located as per the tutorial. Should I be calling DBManager.IncreaseFunds() elsewhere?



  • If you are using the latest version of SIS, currency rewards are given automatically on purchase, defined by the amount specified in the editor window:

    alt text

    If you are running an older version, the IAPListener is the correct location - as recorded in the video tutorial. But if you are running the latest version, defined earnings in the editor window and manually in the IAPListener, then you are giving out double currency to your users.



  • I must have the older version as the correct amount of coins are awarded.

    I'll keep this in mind, however, for future projects.

    Thanks.


Log in to reply