This is a project to demonstrate how to use IronSource’s mediation feature with Huawei Ads Kit.
Platform | Banner Ad | Interstitial Ad | Rewarded Ad |
---|---|---|---|
Native (Java/Kotlin) | âś… | âś… | âś… |
Flutter (Dart) | âś… | âś… | âś… |
- Sign in to Huawei Developer Console and create an AdUnit
Make sure to check the article on How to use Huawei Ads with IronSource mediation ?
- Sign in to your Platform Ironsource and add an App
- Go to SDK Networks, click Manage Networks and add Custom Adapter ( Important Note: Your account must be activated to be able to see Custom Adapter section)
- Enter the Network Key ( Network Key is : 15b993999)
- Enter the ClientID and SecretKey that obtained from Huawei Console
- Click the setup button and update requested parameters (AdUnitID, Rate, TagUnderAgeOfPromise, etc...)
- Add the adapter and its dependencies into your project
- Configuration is done
Important Note: To be able to do mediation, do not forget to disable test mode on IronSource platform.
Network Key | Network Name |
---|---|
15b993999 | HuaweiAds |
Key | Description | Possible value |
---|---|---|
adUnitID | Huawei Ads Unit ID | String |
appID | Huawei Ads App ID | String |
tagForChildProtection | Sets the tag for child-directed content, to comply with the Children's Online Privacy Protection Act (COPPA). |
|
tagUnderAgeOfPromise | Sets the tag for users in the European Economic Area (EEA) under the age of consent, to comply with the General Data Protection Regulation (GDPR). Ad requests with this tag enabled will be unable to obtain personalized ads. |
|
Note: All values ​​must be String format.
In the project-level build.gradle, include Huawei’s maven repository
repositories {
google()
jcenter() // Also, make sure jcenter() is included
maven { url 'https://developer.huawei.com/repo/' } // Add this line
maven {url "https://jitpack.io"} // Add this line
}
...
allprojects {
repositories {
google()
jcenter() // Also, make sure jcenter() is included
maven { url 'https://developer.huawei.com/repo/' } //Add this line
maven {url "https://jitpack.io"} // Add this line
}
}
In the app-level build.gradle, include Huawei Ads dependency (required by the adapter) and the Huawei mediation adapter
dependencies {
//Huawei Ads Prime
implementation 'com.huawei.hms:ads-prime:<latest_version>'
//Adapter SDK
implementation 'com.github.Explore-In-HMS:huawei.ads.ironsource_mediation:<latest_version>'
}
NOTE: If your app can run only on Huawei mobile phones, you can integrate the Huawei Ads Lite SDK instead of Huawei Ads SDK (Optional)
dependencies {
//Huawei Ads Lite
implementation 'com.huawei.hms:ads-lite:<latest_version>'
...
}
The HUAWEI Ads SDK (com.huawei.hms:ads) has integrated the required permissions. Therefore, you do not need to apply for these permissions.
android.permission.ACCESS_NETWORK_STATE: Checks whether the current network is available.
android.permission.ACCESS_WIFI_STATE: Obtains the current Wi-Fi connection status and the information about WLAN hotspots.
android.permission.BLUETOOTH: Obtains the statuses of paired Bluetooth devices. (The permission can be removed if not necessary.)
android.permission.CAMERA: Displays AR ads in the Camera app. (The permission can be removed if not necessary.)
android.permission.READ_CALENDAR: Reads calendar events and their subscription statuses. (The permission can be removed if not necessary.)
android.permission.WRITE_CALENDAR: Creates a calendar event when a user clicks the subscription button in an ad. (The permission can be removed if not necessary.)
- Banner Ad support added
- Huawei Ads SDK version upgraded to latest version.
- IronSource Android SDK version upgraded from 7.3.0 to 7.3.0.1.
- Huawei Ads SDK version upgraded to latest version.
- IronSource Android SDK version upgraded from 7.2.1 to 7.3.0.
- Integration methods of Huawei Ads SDK in the plugin have been changed to compileOnly.
- Huawei Ads SDK (lite or prime) has to be added externally to the app anymore.
Rewarded ad support added
Initial release
This section demonstrates how to use IronSource mediation feature with Huawei Ads Kit on Native android app.
Firstly, integrate the IronSource SDK for Android
IronSource Android SDK can be used for all ad types.
Note :
- Developers can find app level build.gradle in their project from "app-folder/app/build.gradle"
- If you use the native ad format in your application, please submit a ticket here to get support from Huawei.
To use Banner ads in Native android apps, please check the IronSource SDK. Click here to get more information about IronSource SDKs Banner Ad development.
To use Interstitial ads in Native android apps, please check the IronSource SDK. Click here to get more information about IronSource SDKs Interstitial Ad development.
To use Rewarded ads in Native android apps, please check the IronSource SDK. Click here to get more information about IronSource SDKs Interstitial Ad development.
// instantiate IronSourceBanner object, using the IronSource.createBanner API
val banner = IronSource.createBanner(this, ISBannerSize(320, 50))
// init the IronSource SDKAPP_KEY
IronSource.init(this, APP_KEY, IronSource.AD_UNIT.BANNER);
// load ad into the created banner
IronSource.loadBanner(banner);
// add IronSourceBanner to your container
findViewById<FrameLayout>(R.id.frame).addView(banner)
// set the interstitial listener
IronSource.setInterstitialListener(this)
// add impression data listener
IronSource.addImpressionDataListener(this)
// init the IronSource SDKAPP_KEY
IronSource.init(this, APP_KEY,IronSource.AD_UNIT.INTERSTITIAL)
IronSource.loadInterstitial()
if (IronSource.isInterstitialReady()) {
//show the interstitial
IronSource.showInterstitial()
}
// set the IronSource rewarded video listener
IronSource.setRewardedVideoListener(this)
// add impression data listener
IronSource.addImpressionDataListener(this)
// init the IronSource SDK
IronSource.init(this, APP_KEY)
if (IronSource.isRewardedVideoAvailable()) //show rewarded video
IronSource.showRewardedVideo()
This section demonstrates how to use IronSource feature with Huawei Ads Kit on Flutter.
Make sure to check the article on How to use Huawei Ads with IronSource Mediation in Flutter?
Supported Ad Formats are: Banner Ads, Interstitial Ads and Rewarded Ads.
Firstly, integrate the IronSource Flutter Plugin to Flutter.
For more details on IronSource Flutter Plugin visit here
To use Banner ads in Flutter , please check the IronSource Flutter Plugin. Click here to get more information about IronSource Flutter Banner Ad development.
To use Interstitial ads in Flutter, please check the IronSource Flutter Plugin. Click here to get more information about IronSource Flutter Interstitial Ad development.
To use Rewarded ads in Flutter, please check the IronSource Flutter Plugin. Click here to get more information about IronSource Flutter Banner Ad development.
Add the line ironsource_mediation: ^1.1.0 to the dependicies section of your pubspec.yalm file
Go to android file of your project and add necessary configurations in Integrate the Huawei Mediation SDK section
After these configurations is completed you can display Huawei Ads.
Banner Ad |
Interstitial Ad |
Rewarded Ad |
Banner Ad |
Interstitial Ad |
Rewarded Ad |