Prepare for OpenMediation SDK v2.+
We have migrated from AdTiming Mediation SDK to OpenMediation SDK. We also provide some major changes, and simply rename some APIs and remove deprecated APIs.
Integrate the new OpenMediation SDK
You need to re-integrate the new OpenMediation SDK and the Adapter needed to integrate the AdNetwork.
1. Change the gradle script of the integrated aggregation SDK to the following code:
dependencies {
implementation 'com.openmediation:om-android-sdk:2.1.0'
}
2. Refer to the Android SDK Integration documentation, modify the configuration of Proguard and MultiDex, and complete the SDK initialization related code according to the new initialization API.
3. Refer to the integrated documents of the ad unit RewarderVideo, Interstitial, Native and Banner ads, and modify the code related to ad loading and display according to the new ad types and methods. You can refer to the major changes to the SDK API detailed in the follow-up content of this article.
4. The adapter required for the integrated advertising network also needs to be updated. For details, please refer to the Add Mediation Networks section. Here are detailed instructions and script codes required for the integrated advertising network.
Major changes
-
The initialization API has been updated to support passing parameters such as domain name, channel, and pre-loaded ad type. The initialization needs to rely on the InitConfiguration class.
-
Removed interactive ad types and related AdTimingInteractiveAd, InteractiveAdListener API.
-
Added a new cross-promotion ad type, and adds related PromotionAd, PromotionAdListener, PromotionAdRect APIs.
Class renames
The table below lists specific class names that have changed or been removed. In summary:
-
The package name is replaced by com.adtiming.mediationsdk with com.openmediation.sdk.
-
The interactive ad type and related classes AdTimingInteractiveAd and InteractiveAdListener have been removed.
-
For all classes with the prefix AdTiming, the prefix has been deleted.
-
Added a new cross-promotion ad type, and adds related PromotionAd, PromotionAdListener, PromotionAdRect APIs.
AdTiming Mediation Class | OpenMediation Class |
---|---|
com.adtiming.mediationsdk. | com.openmediation.sdk. |
AdTimingAds | OmAds |
InitCallback | InitCallback |
banner.AdSize | banner.AdSize |
banner.BannerAd | banner.BannerAd |
banner.BannerAdListener | banner.BannerAdListener |
interactive.AdTimingInteractiveAd | 已移除 |
interactive.InteractiveAdListener | 已移除 |
interstitial.AdTimingInterstitialAd | interstitial.InterstitialAd |
interstitial.InterstitialAdListener | interstitial.InterstitialAdListener |
nativead.AdIconView | nativead.AdIconView |
nativead.AdInfo | nativead.AdInfo |
nativead.MediaView | nativead.MediaView |
nativead.NativeAd | nativead.NativeAd |
nativead.NativeAdListener | nativead.NativeAdListener |
nativead.NativeAdView | nativead.NativeAdView |
utils.error.AdTimingError | utils.error.Error |
utils.model.Scene | utils.model.Scene |
video.AdTimingRewardedVideo | video.RewardedVideoAd |
video.RewardedVideoListener | video.RewardedVideoListener |
InitConfiguration | |
promotion.PromotionAd | |
promotion.PromotionAdListener | |
promotion.PromotionAdRect |
Methods added/removed
The table below lists the specific changes in version 2.0.0. In summary:
-
The obsolete initialization method was removed from the OmAds class, and a new initialization method was added.
-
Added a new cross-promotion ad type, and adds related PromotionAd, PromotionAdListener, PromotionAdRect APIs.
类 | AdTiming Mediation 中的 API | OpenMediation 中的 API | 备注 |
---|---|---|---|
OmAds |
init(Activity, String, InitCallback,AD_TYPE...) |
init(Activity, InitConfiguration, InitCallback) |
|
InitConfiguration | new InitConfiguration.Builder() .initHost(String) .appKey(String) .logEnable(boolean) .preloadAdTypes(OmAds.AD_TYPE) .build(); |
See SDK Integration | |
PromotionAd | setAdListener(PromotionAdListener) isSceneCapped(String) getSceneInfo(String) loadAd() isReady() showAd(Activity, PromotionAdRect) showAd(Activity, PromotionAdRect, String) hideAd() |
See Promotion | |
PromotionAdListener | onPromotionAdAvailabilityChanged(boolean) onPromotionAdShowed(Scene) onPromotionAdShowFailed(Scene, Error) onPromotionAdHidden(Scene) onPromotionAdClicked(Scene) |
||
PromotionAdRect | setWidth(int) setHeight(int) setScaleX(float) setScaleY(float) setAngle(float) |
Integrate AdTiming SDK
AdTiming is now an independent network. You need to connect to AdTiming Network SDK and Adapter at the same time. For details, please refer to the Add Mediation Networks section.
Comments
Article is closed for comments.