集成 MoPub + Vungle SDK v.6 (iOS)

使用该集成文档,以MoPub为Mediation来集成Vungle SDK 6.5.2.

集成须知

  • Vungle iOS adapter 6.5.2.0已经在MoPub iOS SDK 5.10.0测试通过.
  • 集成之前,请先在Dashboard上设置Vungle为AdNetwork.
  • 请确保使用最新的Xcode来集成SDK

步骤1:MoPub Dashboard设置Vungle优先级

添加Vungle为Ad Network

  1. 登陆MoPub Dashboard并选择Networks.
  2. mceclip0.png

    mceclip1.png
  3. Network Settings 部分,如果需要 Enable reporting access,那么请从Vungle Dashboard上获取 Reporting API Key

    mceclip2.png
  4. 请再App & Ad Unit Setup,填入Vungle Application ID 和 Placement Reference IDs.

    mceclip3.png

步骤2:添加Vungle SDK 和 Adapter

下载 SDKAdapter,解压并放到工程目录Frameworks下,请选择作为Group(黄色)

高级设置

Early SDK Initialization (Recommended)

MoPub iOS SDK 5.5.0及以上支持在MoPub初始化完成时,初始化Vungle SDK。强烈建议使用该功能,来让Vungle SDK有更多时间来提前缓存广告。

示例代码:

MPMoPubConfiguration * sdkConfig = [[MPMoPubConfiguration alloc]
initWithAdUnitIdForAppInitialization:@"MOPUB_AD_UNIT_WITH_VUNGLE_PLACEMENT"];

NSMutableDictionary *configDictionary = [NSMutableDictionary dictionaryWithDictionary:@{ @"appId" : @"YOUR_VUNGLE_APP_ID" }];
// Sets the required minimum available free storage space to be able to initialize the SDK(default value is 50), for example: 50MB
[configDictionary setValue:@(50) forKey:@"vngMinSpaceForInit"];
// Sets the required minimum available free storage space to be able to request an ad(default value is 50), for example: 50MB
[configDictionary setValue:@(50) forKey:@"vngMinSpaceForAdLoad"];

[sdkConfig setNetworkConfiguration:configDictionary forMediationAdapter:@"VungleAdapterConfiguration"];

[[MoPub sharedInstance] initializeSdkWithConfiguration:sdkConfig
   completion:^{
  NSLog(@"SDK initialization complete"); }];

禁止收集 IDFV

自iOS SDK 6.4.3起, publishers可以禁止收集 IDFV 当用户开启 Limit Ad Tracking时。

示例代码:

[VungleRouter.sharedRouter setShouldCollectDeviceId:NO];

Rewarded Ads参数设置


VungleInstanceMediationSettings *settings = [[VungleInstanceMediationSettings alloc] init];
// S2S奖励回调时,获取的user id
settings.userIdentifier = @"VungleTestUser";
// 是否静音
settings.startMuted = YES;
// 设置横竖屏 	0:Auto-rotate 1:Landscape 2:Portrait
settings.orientations = @(1);
// 本次广告为今日第几次播放
settings.ordinal = 5;
[MPRewardedVideo loadRewardedVideoAdWithAdUnitID:rewardPlacement withMediationSettings:@[settings]];

Interstitial Ads 参数设置


// 设置横竖屏 	0:Auto-rotate 1:Landscape 2:Portrait
NSNumber *orientations = [NSNumber numberWithInt:1];

// 本次广告为今日第几次播放
NSString *ordinal = @"3";

// 是否静音
NSNumber *muted = [NSNumber numberWithBool:YES];

NSDictionary *localExtras = @{@"ordinal" : ordinal ?: @"",
                                @"muted" : muted ?: @"",
                                @"orientations" : orientations ?: @""};
self.interstitial.localExtras = localExtras;
Powered by Creativity Driven by Performance Sign Up Here

Questions?

Need further assistance, feel free to reach out to us, we’re here to help!

这篇文章有帮助吗?