广告与广告iPhone 上的 Admob 插页式集成

iAd amp; Admob Interstitial Integration on iPhone(广告与广告iPhone 上的 Admob 插页式集成)
本文介绍了广告与广告iPhone 上的 Admob 插页式集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm currently using Admob GADInterstitial in my iPhone app, and would like to take advantage of the interstitials offered in the iAd UIViewController additions in iOS 7.

My guess is that Apple's fill rate will not be that high, so I'd like to fall back to Admob if an ad isn't available. Unfortunately the API for iAd looks really opaque, and I don't see a way to determine if an ad is available.

Has anyone successfully done this, and if so, how?

解决方案

I missed that the manual presentation approach, calling requestInterstitialAdPresentation, returns a BOOL that says whether an ad will be displayed. Theoretically, I can use this to control whether to fall back to admob. I'll post a comment later on whether it worked or not.

EDIT: It works!

It turns out requestInterstitialAdPresentation does appropriately answer true or false. Then the only thing that remains to make it feel like the other APIs is to figure out when the ad VC is dismissed. I did this by responding in the viewDidAppear: method of the hosting view controller if an ad had been launched. I actually have it encapsulated in an AdManager class,and use an NSNotification to communicate the viewDidAppear:, so was able to drop in iAds pretty cleanly.

这篇关于广告与广告iPhone 上的 Admob 插页式集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)