IAP Ads Removed Pref Error

HI All,

I have implemented IAP in my game to “RemoveAds”, i used Unity IAP and the sample code (Below) this is not the full code but the section that requires the function, in my LevelManager script i have created bool set it to true and i check it before an ad is played, like so, PlayerPrefs.GetInt (“RemovedAds”, 0) == 0) … the whole thing works, i send to alpha testers and they purchase the item but the ads still play, any ideas why?.

// Or ... a non-consumable product has been purchased by this user. else if (String.Equals(args.purchasedProduct.definition.id, kProductIDNonConsumable, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); // TODO: The non-consumable item has been successfully purchased, grant this item to the player. PlayerPrefs.SetInt("AdsRemoved", 1); PlayerPrefs.Save(); Debug.Log("Purchase Complete"); }

What’s calling ShowAds? ShowAds should also be checking to see if that PlayerPref has been set.

Hi @Naphier,

I have figured it out, i did an alpha test build of my latest changes and everything done as it should, but i do want to double check it with another tester who i am waiting for now.

Based on your answers/comments i figured out what i needed to try and it worked smoothly as it should :).

Adding a “Remove Ads” option took me a good month or so now, glad to finally be over it :).