Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How can I get my Fake Store to disappear

Discussion in 'Unity IAP' started by tomlugin100, Jul 11, 2023.

  1. tomlugin100

    tomlugin100

    Joined:
    May 6, 2023
    Posts:
    51
    Hello everyone and thank you for reading! I'm trying to code some inn-app purchases in my game, which I mean to release in the Play Store. When I press the button which calls the inn-app purchase, I get the typical Fake Store pop-up, however even after I press Buy it doesn't go away. If I press Cancel, the Fake Store disappears, but pressing Buy doesn't do it. What might be the issue here? After some troubleshooting I'm still stumped.
    This is my code for the event triggered by the IAP button:
    Code (CSharp):
    1.  
    2. public void purchase(Product product)
    3.     {
    4.         coloredSquare.GetComponent<Image>().color = colors[colorIndex];
    5.  
    6.     }
    7.  
    Because I'm just testing at the moment, I just want it to colorize a square I have in my scene. That doesn't work either. Thank you for your help
     
  2. Dennis_eA

    Dennis_eA

    Joined:
    Jan 17, 2011
    Posts:
    375
    I guess you're not purchasing anything in the end, that's why your fake store doesn't register it at all..
    I followed this video and it was really helpful:


    Hopefully it's also helpful for you :)


    - Dennis
     
  3. tomlugin100

    tomlugin100

    Joined:
    May 6, 2023
    Posts:
    51
    Thank you Dennis @Dennis_eA. I believe the problem I was having had to do with the code I was using to colorize the square. It didn't have to do with IAP. Like you said, I wan't purchasing anything, and worse yet, I had an error in my colorization code. Thank you for the video, I'll take a look at it.
    Humbly,
    Tom