Unity codeless IAP works in editor and nothing happens on iphone

Hey all, so I’ve been trying to get Unity IAPs working for a while now and still can’t figure it out. Everything works as intended with the fake store within the Unity editor. But the second I build the iOS build, then use Xcode to put it on my iPhone 6, with a sandbox account, the actual codeless IAP button doesn’t do anything. I mean literally 0.

I get no fatal error messages within Xcode, nor in the Unity log files. This is my log after trying it in the editor:

UnityAdsEditor: Initialize(2630602, True);
UnityEditor.Advertisements.UnityAdsEditor:EditorOnLoad()

Initializing UnityPurchasing via Codeless IAP
UnityEngine.Purchasing.IAPButton:OnEnable()

UnityIAP Version: 1.20.0
UnityEngine.Purchasing.IAPButton:OnEnable()

Using configuration builder objects
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

UnityIAP: Promo interface is available for 1 items
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Ad was skipped before end.
UnityEngine.Debug:Log(Object)
LevelManager:HandleShowResult(ShowResult) (at Assets/Scripts/LevelManager.cs:171)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)

IAPButton.PurchaseProduct() with product ID: com.xaagaming.bjorn.123
UnityEngine.EventSystems.EventSystem:Update()

purchase({0}): com.xaagaming.bjorn.123
UnityEngine.EventSystems.EventSystem:Update()

Basically clicking that purchase button and selecting “YES” for purchasing, sets an integer to 1. If that integer is 0, then post death ads play. However, if you purchase this for 0.99 cents, then the post death ads stop playing.

//disabling ads
    public void purchaseFulfillmentNoAds(){
        noAdsPurchase = 1;
        Debug.Log ("No Ads have been purchased");

        PlayerPrefs.SetInt ("noAdsPurchase", 1);
    }

Then in my respawnCoroutine I have this because it plays ads right before you respawn.

//Advertisement.Show();
        if (noAdsPurchase == 0) {
            showAds ();
        }

I get this message after clicking on the codeless IAP button that reads:

Do you want to Purchase com.CompanyName.GameName ?
Environment: Fake Store
Yes/NO

When I click yes, everything works fine. I just can’t get this to work within a test environment…

@Paratrooper82 Please show a screenshots of your Products as defined in the Unity IAP Catalog, and on iTunes Connect as described here:

Also, please show the iOS logs

I am experiencing the same problem, works in editor but not when built. I am using the codless IAP buttons and have ticked the ‘Automatically initialize UnityPurchasing’ box so I assume that I do not need to manually implement UnityPurchasing as suggested in the links supplied by Jeff?

My same recommendations apply here also (screenshots and logs)

Anyone that solved this problem ?

Did you fix the issue ?

If you could provide the logs, I likely could suggest a solution

1 Like

It was working until I updated to 2019. I am using Unity 2019.1.2f1. I tried deleting the IAP folders, reimporting the plugin, I updated the plugin. I tried to reimport all the assets. Nothing worked. I checked that my products in IAP catalog have the same names as the ones in the play store console.
In the editor it works fine. But in the android device, when I click on the IAP button nothing happens.

Unfortunately, I can’t provide the logs now !!

Yes, we are having issues with IAP on Unity 2019 as posted on this forum.

I fixed the error by removing Unity IAP 1.22 and installing Unity IAP 1.20. Now when I click on the iap button, google purchase dialog pops up.
I am using Unity 2019.1.2f1 and IAP 1.22 didn’t work for me.

How did you install the older version?

Nevermind, I just found the sticky :slight_smile:

im having the same issue with unity 2019.3.6f1 tried everything. Works in unity but in final build nothing . like a dead button .

How are you debugging on the device? Then I can provide specific details.

1 Like

This may help Tips for new Unity users - Getting Started - Unity Discussions . And attach the device logs, the Debug.Log statements will show in the logs How To - Capturing Device Logs on Android