Search Unity

remove ads with button

Discussion in 'Unity Ads & User Acquisition' started by Gdakkutlu, Mar 20, 2019.

  1. Gdakkutlu

    Gdakkutlu

    Joined:
    Nov 9, 2016
    Posts:
    47
    Hi all;

    I use the Unity IAP and I need only the remove ads purchase, so I only use non-consumable product.
    My main question is, how should I remove ads with that button?

    Should I destroy the adsManager game object at my scene which controls the ads?
    Or is there any way which better than this?

    And also, do I need to check whether player bought it or not at the beginning of game launches?

    Thank you a lot.
     
  2. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    bool isBuyNoAds;

    void BuyNoAds(){
    //Do
    }

    Save it

    When ads will show up

    if(!isBuyNoAds){
    //Show Ads
    }
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, you need to check if the user purchased a product previously previously. An easy approach is to save the purchase information to PlayerPrefs, but is not totally secure, and PlayerPrefs are generally removed during a reinstall. But you can start with PlayerPrefs and improve over time. https://docs.unity3d.com/ScriptReference/PlayerPrefs.html .
     
  4. vive_creative

    vive_creative

    Joined:
    Mar 22, 2019
    Posts:
    12
    What would happen if one uninstalls and reinstall the app? I believe playerprefs wouldn't work in this case
     
  5. StartStart

    StartStart

    Joined:
    Jan 2, 2013
    Posts:
    150
    IAP Restore or Cloud Save.
     
  6. Yasuyuki

    Yasuyuki

    Unity Technologies

    Joined:
    Sep 11, 2014
    Posts:
    153