I want to a share single banner view (GADBannerView / single adUnit) across couple UIViewControllers while preserving the impression count. I've so far taken following approach:
When navigation between controllers:
bannerView.removeFromSuperview() // so remove from current VC appearingVC.view.addSubview(bannerView) // add to appearing VC My assumption was that since I 'move' this view around - ad does not reload / impression count does not increase (unless ad reloads based on the config interval).
This works as far as UIView goes, but each time banner is removed from current VC and re-added to appearing VC - the add reloads on its own. This subsequently causes short delay before it re-appears but also increments the impression count.
To be specific: the first time UIViewController loads -> banner reloads the ad. Let's say I have UITab bar with 3 controllers -> once all 3 controllers have loaded, switching between tabs does not trigger further reloads (except for the expected interval based reload). Initially switching form one tab to another -> ad view reloads :(
I ever only create one strong instance of GADBannerView and I only call load(GADRequest()) once. This leads me to think AdMob has some UI observers and detects screen transitions etc...
- Is my approach invalid?
- Should I create separate adUnit per each UIViewController?
- I could embed my navigation controller into sub container (i.e just have the banner fixed on top of screen) but I like the freedom of deciding where to display the banner
没有评论:
发表评论