Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Google Play IAP button just not working, but no errors, no reason I can see

Discussion in 'Unity IAP' started by grog3, Jan 11, 2019.

  1. grog3

    grog3

    Joined:
    Feb 22, 2016
    Posts:
    10
    It sucks to write this as I don't have anything to go on, therefore no hints to share.

    The game is a visual novel with a single buy button on a canvas. It is running the Fungus visual story package and almost nothing else. I've built these before, and they always worked, they still work.

    In the test mode in the editor, I get no errors or warnings. It executes the Completed Purchase function exactly as it should.

    But now, when I go to run it through an internal, closed or open track, the button clicks, but it just does not bring up the payment portal. I have tried with license testers and not.

    I am baffled. Would be happy to add someone to the test group. Is this happening to anyone? Is it something simple in the IAP store window or build settings?

    Thanks
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide the results of your debugging on the device. You can step debug on the device from Visual Studio. But probably easier, provide the device logs. Debug.Log statements will show in the logs There is a working sample project available also https://forum.unity.com/threads/how-to-capturing-device-logs-on-android.528680/ and https://forum.unity.com/threads/sample-iap-project.529555/ . Also make sure to follow the steps here: https://docs.unity3d.com/Manual/UnityIAPGoogleConfiguration.html
     
  3. grog3

    grog3

    Joined:
    Feb 22, 2016
    Posts:
    10
    Hey thanks for the reply, I'm testing something, forgot that I ran into some weird errors when I updated to the latest IAP and it was easiest to solve by letting the game run a few frames upon return to let the button set back to inactive. That's the only difference so I'll chase it for a bit, but thanks for the quick reply Jeff.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you are using Codeless IAP, keep in mind that you likely will need a Listener. Codeless IAP only works when the buttons are active. The second sample project uses Codeless.
     
  5. grog3

    grog3

    Joined:
    Feb 22, 2016
    Posts:
    10
    Cool, thanks for the hint, didn't know that. -g
     
  6. Fyrebend

    Fyrebend

    Joined:
    Apr 28, 2019
    Posts:
    18
    I am having this problem, and I have no clue what to do. Do i need a Listener if my buttons are always active? in my scene there is no script to disable them so they should be active from scene load to unload, right? Also, would i need a listener even when the fake store comes up in the editor? the problem only happens on the device as far as ive seen.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    No, you would need a listener in this case. What you do need however, is to provide the device logs!
     
  8. Shmoji

    Shmoji

    Joined:
    Nov 16, 2017
    Posts:
    14
    I am using Codeless IAP and having the issue where everything works fine in the editor (fake store is shown), but on my device the click of the buy button does not bring up anything.

    When you say a Listener is needed, what does that mean, what do I do to implement whatever is needed for a Listener?

    I would provide log files, but I just learned about logcat and there is so much stuff it logs, I would not want to post it all. Any logcat tips with Unity? Also, I don't know if I should start another thread or just use this one.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please see my previous post on this thread on Jan 11 for answers to your questions, I provided links to the sample project that has a listener, how to capture the logs, and general configuration instructions.
     
  10. Shmoji

    Shmoji

    Joined:
    Nov 16, 2017
    Posts:
    14
    Okay, so in Manual: Codeless IAP I found some documentation for adding IAP Listener. However, I do not really understand the point of it. Does it replace IAP Button? Do I need both IAP Button and IAP Listener? I do not know if this is my issue, but I would at least like to understand when to use IAP Button and when to use IAP Listener when using Codeless IAP
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The IAP Listener is for projects that don't have the IAP button active on the initial scene. An IAP button must be active and visible for it to work. The listener allows you to listen to purchase events when the app starts, such as restore events, if you have your buttons hidden. But if you're struggling with Codeless, then use scripted. I actually find it easier to use. There are two sample projects provided in the link, the first is scripted, the second is codeless, with a listener.
     
    Shmoji likes this.
  12. Shmoji

    Shmoji

    Joined:
    Nov 16, 2017
    Posts:
    14
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Shmoji likes this.