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

Can I dis-own my in app product?

Discussion in 'Android' started by cephalo2, Apr 17, 2019.

  1. cephalo2

    cephalo2

    Joined:
    Feb 25, 2016
    Posts:
    262
    I have an in app product that stops ads in my app. I want to test it, but I'm afraid if I hit that purchase button, I will always own the product and then have to jump through hoops to test the version of my app that does have ads.

    Testing a different build from the production build isn't really testing.

    Ideally, I would like to buy, refund, buy, refund, ad infinitum as I see fit.

    I could place a secret debug mode that shows ads even if I own the 'no ads' product but that's a can o worms. Just imagine releasing that on accident.

    I've never made an in app purchase from the Google Play store and I have no idea what to expect.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You really only need to test the purchase flow once to confirm that it is working. Then in your testing, simply use another button that simulates the purchase. Otherwise, you'll need to configure multiple products as you correctly describe that you can only purchase it once. Another option is to have multiple test users. Generally you'll want to post these questions in the IAP forum https://forum.unity.com/forums/unity-iap.112/
     
  3. cephalo2

    cephalo2

    Joined:
    Feb 25, 2016
    Posts:
    262
    I went ahead and impulsively pressed the button. I went into my orders, and refunded and revoked the product. We will see if that works after I uninstall and reinstall. I would rather have the ad version, since that's the version that most people will be using, to see if the ads flow well with the rest of the game, etc.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, you can still use the ad version, just configure multiple products to do the same thing. You can use any product purchase to turn off ads. I would not recommend multiple refunds, you might get flagged by Google. They generally only allow a single refund.
     
  5. cephalo2

    cephalo2

    Joined:
    Feb 25, 2016
    Posts:
    262
    After clearing my cache and data, My PlayerPrefs are clearly wiped, but my IAP code is definitely finding the product still, so refunding and revoking the 'test card purchase' did not remove my owndership in case anyone is wondering.
     
  6. cephalo2

    cephalo2

    Joined:
    Feb 25, 2016
    Posts:
    262
    I just have one more quick question, when I am in the editor, I coded the keypress shift-A to turn ads back on, easy to do when you have a keyboard. Is there some kind of secret input I can do on an android phone to do something similar, that a user wouldn't think of but that I can use? Bringing up the keyboard in a text field isn't working for this.

    Now that I've ruined my google user account for ads, I might want something like this.

    EDIT: Ok, after I uninstalled the app, and then installed the production version from Google play, I against lost access to the product. Which is great! It's all very confusing though.
     
    Last edited: Apr 17, 2019
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    How did shift-A turns ads on and off? You need to turn ads on and off in code. Please try my suggestions. You don't want to use the refund approach each time, Google will likely prevent you from doing so. Personally I have multiple products (and free test accounts) that I test with for this exact purpose.
     
  8. cephalo2

    cephalo2

    Joined:
    Feb 25, 2016
    Posts:
    262
    I just made a little keyboard handler in my AdManager object for testing. If someone owns the IAP, normally it sets my variable 'showAds' to false in ProcessPurchase. Shift A just turns them back on, 'showAds = true' irrespective of the product ownership. Thing is, I can't press Shift A on my phone.