首页 > 代码库 > iad与admob混用
iad与admob混用
iAd+Admob混用,在收不到iAd广告的时候用admob,一旦收到iAd广告就把admob关闭。这样可以实现在不支持iAd的国家里,开启admob。并不需要判断国家。
判断方法有三点主要事项:
判断方法有三点主要事项:
- 同时请求iAd和admob
- 如果收到iAd广告就把admob关了
- 收到admob广告5次了,说明到目前未知还是没有收到iAd,这样说明你收不到iAd广告就可以关闭iAd了
1,将目录admob sdk 加载入工程,在Xcode->TARGETS->Build Seetings->Linking->Other Linker Flags中添加"-ObjC"
2,USE IN ARC ===>-fno-objc-arc
If your project is compiled with ARC, you‘ll need to disable it for the IASK files. You can do so by adding -fno-objc-arc in the "Compile Sources" phase. You can select all the relevant files at once with shift-click and then double-click in the Compiler Flags column to enter the text.
3.1 添加相关的Framework到库,在Xcode->TARGETS->Build Phases->Link Binary With Libraries中添加:
2,USE IN ARC ===>-fno-objc-arc
If your project is compiled with ARC, you‘ll need to disable it for the IASK files. You can do so by adding -fno-objc-arc in the "Compile Sources" phase. You can select all the relevant files at once with shift-click and then double-click in the Compiler Flags column to enter the text.
3.1 添加相关的Framework到库,在Xcode->TARGETS->Build Phases->Link Binary With Libraries中添加:
- AdSupport.framework
- AudioToolbox.framework
- AVFoundation.framework
- CoreGraphics.framework
- MessageUI.framework
- StoreKit.framework
- SystemConfiguration.framework
- libGoogleAdMobAds.a
- iAd.framework
- CoreTelephony.framework
3.2 6.12后还需要增加
- EventKitUI.framework
- EvnetKit.framework
3.3 cocos2dx需要多增加
- MediaPlayer.framework
- GameController.framework
4 修改添加广告支持的基类ADHelper
[eaglView addSubview:[ADHelpergetInstance].view];
iad与admob混用
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。