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.
bool isBuyNoAds;
void BuyNoAds(){
//Do
}
Save it
When ads will show up
if(!isBuyNoAds){
//Show Ads
}
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. Unity - Scripting API: PlayerPrefs .
What would happen if one uninstalls and reinstall the app? I believe playerprefs wouldn’t work in this case
IAP Restore or Cloud Save.
Yes. In order to support reinstalling the app or replacing the device, for instance, the product should be set as a non-consumable or subscription, then it can be restored on the first time launch with a new install.
https://docs.unity3d.com/Packages/com.unity.purchasing@4.7/manual/UnityIAPRestoringTransactions.html