封装了不同的横幅广告网络实现,并实现简单的调介逻辑以最大化填充率
支持的网络
- RevMob
- Chartboost
- Tapjoy(目前仅安装跟踪)
用法
首先导入头文件
#import <GBAds/GBAds.h>
在 application:didFinishLaunching:withOptions:
中连接您可能想要调介的任何网络
//Connect RevMob
[GBAds connectNetwork:GBAdNetworkRevmob withCredentials:@"RevmobAppID"];
//Connect Chartboost
[GBAds connectNetwork:GBAdNetworkChartboost withCredentials:@"ChartboostAppID", @"ChartboostAppSig"];
//Connect Tapjoy
[GBAds connectNetwork:GBAdNetworkTapjoy withCredentials:@"TapjoyAppId", @"TapjoySecret"];
配置中继(后备)逻辑。在这种情况下,库将尝试从revmob加载广告3次,然后从chartboost加载2次。只会展示一个广告,这只是为了定义一个后备方案。以0结束列表!
[GBAds configureAdLogic:GBAdNetworkRevmob, GBAdNetworkRevmob, GBAdNetworkRevmob, GBAdNetworkChartboost, GBAdNetworkChartboost, 0];
展示一个广告,可以在任何地方调用此函数
[GBAds showAd];
选项
[GBAds enableDebug:YES]; //prints debug info to console, defaults to NO
[GBAds enableAds:NO]; //temporarily lets you enable/disable ads, e.g. while during an in-app flow, defaults to YES. If this is set to NO, then [GBAds showAd] does nothing.
[GBAds showAdsDuringFirstSession:NO]; //Allows you to specify whether or not to show an ad on the first ever app launch, defaults to YES
依赖项
版权和许可证
版权所有 © 2014 Luka Mirosevic
遵循Apache License 2.0版本(“许可证”);除非根据许可证明确许可,否则不得使用本作品。你可以在LICENSE文件中或在此检索许可证:
https://apache.ac.cn/licenses/LICENSE-2.0
除非适用法律要求或经书面同意,否则在许可证下分发的软件按“原样”基础分发,不提供任何明示或暗示的保证。请参阅许可证了解具体管理许可和限制的语言。