本文记录了Pubeasy SDK 的变更情况。
发版日期:2024-05-28
Pubeasy sdk
// 设置是否允许获取设备信息。 默认是YES 不建议改为NO 当改为NO时没填充 [Pubeasy setAllowReportDeviceInfo:YES];// sdk 初始化 会获取 ua 信息 [Pubeasy initConfig:^(BOOL success, NSString *error) { NSLog(@"sdk init success = %@",[Pubeasy getSdkVersion]);}];x[ad notifyBidWin:[rvAd getPrice]];
1. 含义: Pubeasy 广告竞价成功调用2. 调用时机: load 之后 show之前, 比价 胜出 调用 3. 价格默认填写返回可以。如果需要自定义价格联系运营同学沟通
展示 RV 和 IV ,mute为视频是否静音。YES 静音 NO 不静音 默认NO[self.ivAd presentFromRootViewController:self];[self.ivAd presentFromRootViewController:self mute:NO];
加载广告
xxxxxxxxxx[PubeasyRewardAd loadAdWithAdUnitId:@"P0HXER86621E99BP" loadCallback:^(PubeasyRewardAd *rvAd, NSString *error) { if (error) { NSLog(@"load error %@",error); [self appendText:[NSString stringWithFormat:@"load error %@",error]]; return; } [self appendText:@"load success "]; if (!self.ad) { self.ad = rvAd; } [rvAd notifyBidWin:[rvAd getPrice]]; rvAd.adDelegate = self; [rvAd presentFromRootViewController:self];}];| 参数 | 描述 |
|---|---|
| PubeasyRewardAd rvAd | 激励视频广告实体类 |
| NSString error | 发生异常时的错误信息 |
展示广告
xxxxxxxxxxrvAd.adDelegate = self;// 设置广告代理[rvAd presentFromRootViewController:self];注册 PubeasyRVAdDelegate Callback
xxxxxxxxxxadDelegate 方法
- (void)adDidShow:(PubeasyRewardAd *)ad { [self addLog:[@"adDidShow " stringByAppendingFormat:@"%f", [ad getPrice]]];}- (void)adDidClick:(PubeasyRewardAd *)ad { [self addLog:[@"adDidClick" stringByAppendingFormat:@"%f", [ad getPrice]]];}- (void)adDidDismiss:(PubeasyRewardAd *)ad { [self addLog:[@"adDidDismiss" stringByAppendingFormat:@"%f", [ad getPrice]]];}- (void)rewardedAd:(PubeasyRewardAd *)ad { [self addLog:[@"rewardedAd" stringByAppendingFormat:@"%f", [ad getPrice]]];}加载广告
xxxxxxxxxx[PubeasyInterstitialAd loadAdWithAdUnitId:@"PCPK8KN6638AC6DI" loadCallback:^(PubeasyInterstitialAd *ivAd, NSString *error) { if (error) { NSLog(@"load error %@",error); [self appendText:[NSString stringWithFormat:@"load error %@",error]]; return; } [self appendText:@"load success "]; ivAd.adDelegate = self; [ivAd notifyBidWin:[ivAd getPrice]]; [self.ivAd presentFromRootViewController:self];}];| 参数 | 描述 |
|---|---|
| PubeasyInterstitialAd ivAd | 插屏视频广告实体类 |
| NSString error | 发生异常时的错误信息 |
展示广告
xxxxxxxxxxrvAd.adDelegate = self;// 设置广告代理[self.ivAd presentFromRootViewController:self];注册 PubeasyIVAdDelegate Callback
xxxxxxxxxxadDelegate 方法- (void)adDidShow:(PubeasyInterstitialAd *)ad { [self addLog:[@"adDidShow " stringByAppendingFormat:@"%f", [ad getPrice]]];}- (void)adDidClick:(PubeasyInterstitialAd *)ad { [self addLog:[@"adDidClick" stringByAppendingFormat:@"%f", [ad getPrice]]];}- (void)adDidDismiss:(PubeasyInterstitialAd *)ad { [self addLog:[@"adDidDismiss" stringByAppendingFormat:@"%f", [ad getPrice]]];}加载广告
xxxxxxxxxx[PubeasyBannerAd loadAdWithAdUnitId:@"P5SNP7Q6638ACC8I" adSize:[PubeasyBannerAdSize initWithWH:320 height:50] loadCallback:^(PubeasyBannerAd *bannerAd, NSString *error) { int btnW = self.view.frame.size.width - 100; bannerAd.frame = CGRectMake(50, self.view.frame.size.height -btnW * 6 / 5 , btnW, btnW * 6 / 5); bannerAd.adDelegate = self; [bannerAd notifyBidWin:[bannerAd getPrice]]; [self.view addSubview:bannerAd];}];| 参数 | 描述 |
|---|---|
| PubeasyBannerAd bannerAd | Banner 广告实体类 |
| NSString error | 发生异常时的错误信息 |
| PubeasyBannerAdSize | Banner 宽高封装类 单位px |
展示广告
xxxxxxxxxxbannerAd.adDelegate = self;[self.view addSubview:bannerAd];注册 PubeasyBannerAdDelegate Callback
xxxxxxxxxxadDelegate 方法
- (void)adDidShow:(PubeasyBannerAd *)ad { NSLog(@"banner show %f",[ad getPrice]); }- (void)adDidClick:(PubeasyBannerAd *)ad { NSLog(@"banner click %f",[ad getPrice]);}若在使用 SDK 过程中遇到问题,可参考此文档解决。