OpenMediation 迁移准备 - iOS

为OpenMediation SDK做准备

我们已经由 AdTiming Mediation SDK 迁移至 完全开源的OpenMediation SDK,同时提供一些重大更改,并简单重命名一些 API 以及移除已弃用的 API。

 

集成新的OpenMediation SDK/Adapter

1. 如果您使用的是自动集成SDK方式,请将Cocoapods命令修改为以下代码:

pod 'OpenMediation','2.0.2'
Copy

如果您使用的是手动集成SDK的方式,具体请参考集成广告网络进行操作。

2. 参考集成广告网络进行操作,更新集成广告网络所需要的Adapter。

3. 参考iOS SDK下载与集成文档的说明,更新初始化方法。

4. 参考广告单元激励视频插屏广告原生广告横幅广告的集成文档,更新广告类名,加载展示方法和代理回调方法。

 

Api类名变化

OpenMediation SDK中移除了所有包含AdTiming的类名和回调方法,同时新增交叉推广广告类型,各广告类型的回调方法变化请参考广告单元部分文档,下面是主要的类名变化。

AdTiming类名 OpenMediation类名
AdTiming OpenMediation
AdTimingBanner OMBanner
AdTimingBannerDelegate OMBannerDelegate
AdTimingNative OMNative
AdTimingNativeAd OMNativeAd
AdTimingNativeView OMNativeView
AdTimingNativeDelegate OMNativeDelegate
AdTimingInterstitial OMInterstitial
AdTimingInterstitialDelegate OMInterstitialDelegate
AdTimingRewardedVideo OMRewardedVideo
AdTimingRewardedVideoDelegate OMRewardedVideoDelegate

 

回调方法名变化

横幅广告

/// AdTiming 回调方法

- (void)adtimingBannerDidLoad:(AdTimingBanner *)banner;

- (void)adtimingBannerDidFailToLoad:(AdTimingBanner *)banner withError:(NSError *)error;

- (void)adtimingBannerWillExposure:(AdTimingBanner *)banner;

- (void)adtimingBannerDidClick:(AdTimingBanner *)banner;

- (void)adtimingBannerWillPresentScreen:(AdTimingBanner *)banner;

- (void)adtimingBannerDidDismissScreen:(AdTimingBanner *)banner;

- (void)adtimingBannerWillLeaveApplication:(AdTimingBanner *)banner;

 

/// OpenMediation 回调方法

- (void)omBannerDidLoad:(OMBanner *)banner;

- (void)omBanner:(OMBanner *)banner didFailWithError:(NSError *)error;

- (void)omBannerWillExposure:(OMBanner *)banner;

- (void)omBannerDidClick:(OMBanner *)banner;

- (void)omBannerWillPresentScreen:(OMBanner *)banner;

- (void)omBannerDidDismissScreen:(OMBanner *)banner;

- (void)omBannerWillLeaveApplication:(OMBanner *)banner;

 

原生广告

/// AdTiming 回调方法

- (void)adtimingNative:(AdTimingNative*)native didLoad:(AdTimingNativeAd*)nativeAd;

- (void)adtimingNativeDidFailToLoad:(AdTimingNative*)native withError:(NSError*)error;

- (void)adtimingNativeWillExposure:(AdTimingNative*)native;

- (void)adtimingNativeDidClick:(AdTimingNative*)native;

 

/// OpenMediation 回调方法

- (void)omNative:(OMNative*)native didLoad:(OMNativeAd*)nativeAd;

- (void)omNative:(OMNative*)native didFailWithError:(NSError*)error;

- (void)omNativeWillExposure:(OMNative*)native;

- (void)omNativeDidClick:(OMNative*)native;

 

插屏广告

/// AdTiming 回调方法

- (void)adtimingInterstitialChangedAvailability:(BOOL)available;

- (void)adtimingInterstitialDidOpen:(AdTimingScene*)scene;

- (void)adtimingInterstitialDidShow:(AdTimingScene*)scene;

- (void)adtimingInterstitialDidClick:(AdTimingScene*)scene;

- (void)adtimingInterstitialDidClose:(AdTimingScene*)scene;

- (void)adtimingInterstitialDidFailToShow:(AdTimingScene*)scene withError:(NSError *)error;

 

/// OpenMediation 回调方法

- (void)omInterstitialChangedAvailability:(BOOL)available;

- (void)omInterstitialDidOpen:(OMScene*)scene;

- (void)omInterstitialDidShow:(OMScene*)scene;

- (void)omInterstitialDidClick:(OMScene*)scene;

- (void)omInterstitialDidClose:(OMScene*)scene;

- (void)omInterstitialDidFailToShow:(OMScene*)scene withError:(NSError *)error;

 

激励视频

/// AdTiming 回调方法

- (void)adtimingRewardedVideoDidLoad:(NSString *)placementID;

- (void)adtimingRewardedVideoDidFailToLoad:(NSString *)placementID withError:(NSError *)error;

- (void)adtimingRewardedVideoDidOpen:(NSString*)placementID;

- (void)adtimingRewardedVideoPlayStart:(NSString*)placementID;

- (void)adtimingRewardedVideoPlayEnd:(NSString*)placementID;

- (void)adtimingRewardedVideoDidClick:(NSString*)placementID;

- (void)adtimingRewardedVideoDidReceiveReward:(NSString*)placementID;

- (void)adtimingRewardedVideoDidClose:(NSString*)placementID;

- (void)adtimingRewardedVideoDidFailToShow:(NSString*)placementID withError:(NSError *)error;

 

/// OpenMediation 回调方法

- (void)omRewardedVideoChangedAvailability:(BOOL)available;

- (void)omRewardedVideoDidOpen:(OMScene*)scene;

- (void)omRewardedVideoPlayStart:(OMScene*)scene;

- (void)omRewardedVideoPlayEnd:(OMScene*)scene;

- (void)omRewardedVideoDidClick:(OMScene*)scene;

- (void)omRewardedVideoDidReceiveReward:(OMScene*)scene;

- (void)omRewardedVideoDidClose:(OMScene*)scene;

- (void)omRewardedVideoDidFailToShow:(OMScene*)scene withError:(NSError *)error;
这篇文章有帮助吗?
0 人中有 0 人觉得有帮助

评论

0 条评论

文章评论已关闭。