Reputation: 32061
I have an in app purchase in my app that removes all ads. When the in app purchase is purchased, a simple BOOL isPremium
is set to YES
. Now, before any view loads, it checks whether isPremium is YES or not to display ads. If it is not, it adds an adView
in the viewDidLoad
method. If it is premium, then I set adView.hidden=YES
. Is this the right way to do it? Doesn't this way somehow affect my ad optimization? Will my ad network think the ads are still showing and refreshing even though they are hidden? What's the right way to do this?
Upvotes: 1
Views: 493
Reputation: 49376
Why create the AdView if you're just going to hide it straight away? Create it and add it to the view hierarchy only if ads will be displayed. This way, there can be no confusion over whether a "hidden" banner still creates impressions in the advertising network.
Edit: To remove the view if it's already in the hierarchy, just call [adView removeFromSuperview]
. You might want to release it as well (`[adView release]').
Upvotes: 1