IAP button not connecting to store in published build

Hello everyone,
before starting I have tried, reading ALL the documentation 3 times over (and reading old documentation), writing my own code using the documentation, using codeless IAP and following other peoples code, all result in the same result; working in the editor not working in the build. Therefore all problems I am talking about are not showing when just pressing play in unity.

For this, lets just try and workout what is wrong with my codeless IAP button located at Window > Unity IAP > Create IAP Button.

Currently pressing the button in Unity displays the fake store, when pressing the button in published nothing at all happens please see below my components (exc. rect transform).


Note: No failed purchase function and no OnClick function for now, just looking at getting the button to work first.

The StorePurchase Script is just the script taken from the documentation and removes a GameObject and functions fine inside Unity, should be no errors here.

I have successfully exported and then imported my Google play CSV and set active to the IAP purchase from inside my published app in google play (therefore my IDs and prices match).

Thankyou if you have made it this far, I have been stuck reading documentation over for 6 days now.
So this brings me to my question: Why does clicking purchase bring up the fake store from within unity and function fine without errors and show all the correct Console lines as shown in the documentation but not work at all when published?

Kind regards,

Dillon

Is the scene active with the IAP button instantiated? The buttons need to be active for them work. Can you provide your device logs? Your Debug.Log statements would appear in the logs also How To - Capturing Device Logs on Android

Thank you for the response, here is my device Log as a text file attached.

What do you mean by “is the scene active” and “IAP button instantiated”. I really do appreciate the response. The scene is in the build with a tick next to it (I assume that means it is active). The IAP button is the codeless button and is always in the scene therefore the unity engine deals with the instantiation, correct?

3724801–308386–Device Logs for unity.txt (6.22 KB)

You just provided a screen shot of your terminal window, not the device logs (which look to be in log.txt). I think you attached the wrong file. Also, an active scene is the scene that is currently visible, and the buttons are not explicitly disabled for example. But it sounds like you are not doing that, so we’re good. Just provide the device logs and we can take a look. To answer your previous question, in the Editor, IAP is not actually connecting to a store. Only when published to a device does it connect to a store. Make sure you follow the step-by-step directions here Unity - Manual: Configuring for Google Play Store And please don’t multi-post

Are yes apologies for that. So I went into the store through the assets tab and downloaded the Unity IAP store prefab to see if I was doing something wrong, doing this resulted in my buttons working even before using the prefab from the store. My guess is that something was missing somewhere upon importing the unity IAP package that was fixed on importing this prefab asset. To summarise my understanding, I did nothing but import someone elses prefab which replaced and reimported some existing files.

Please note that you can’t use the account that publishes your app to do the test. You should use another Google account and add it as a tester. And you need to install the app from the store (or side load it on top of an app installed from the store). Then you’re able to test IAP products.

More information can be found on this page below.

How did you solve this problem?

What did you download sorry? I am facing the same problem, how to download “Unity IAP store prefab” ?

Hi @mt8791811 ,
The download refer to the IAP catalog export, see this page, section “Exporting to an app store”.