Search Unity

IAP button not connecting to store in published build

Discussion in 'Unity IAP' started by AmatuerProgrammer, Sep 10, 2018.

  1. AmatuerProgrammer

    AmatuerProgrammer

    Joined:
    Jun 15, 2017
    Posts:
    15
    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).

    upload_2018-9-10_12-43-45.png
    Note: No failed purchase function and no OnClick function for now, just looking at getting the button to work first.
    upload_2018-9-10_12-54-55.png
    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.

    upload_2018-9-10_12-57-36.png

    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
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. AmatuerProgrammer

    AmatuerProgrammer

    Joined:
    Jun 15, 2017
    Posts:
    15
    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?
     

    Attached Files:

  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    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 https://docs.unity3d.com/Manual/UnityIAPGoogleConfiguration.html And please don't multi-post
     
    Last edited: Sep 27, 2018
  5. AmatuerProgrammer

    AmatuerProgrammer

    Joined:
    Jun 15, 2017
    Posts:
    15
    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.
     
  6. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    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.
    https://docs.unity3d.com/Manual/UnityIAPGooglePlay.html
     
  7. AlexVet

    AlexVet

    Joined:
    Mar 19, 2015
    Posts:
    1
    How did you solve this problem?
     
  8. mt8791811

    mt8791811

    Joined:
    Feb 13, 2021
    Posts:
    2
    What did you download sorry? I am facing the same problem, how to download "Unity IAP store prefab" ?
     
  9. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    183
    Hi @mt8791811,
    The download refer to the IAP catalog export, see this page, section "Exporting to an app store".