Skip to content

Explore-In-HMS/huawei.ads.applovin_mediation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 

Repository files navigation

Huawei-Applovin Mediation Github Documentation

Latest Version
Supported Platforms

Introduction

In this documentation we explained how to use Huawei-Applovin mediation plugin developed by Applovin. Plugin repository link is here

Compatibility

Banner Ad Interstitial Ad Rewarded Ad Native Ad MREC
Native (Java/Kotlin)
Unity

How to start?

Create an ad unit on Huawei Publisher Service

  1. Sign in to Huawei Developer Console and create an AdUnit

Create a mediation network on Applovin

  1. Sign in to Applovin dashboard

  2. Go to "Networks -> Click here to add a Custom Network"

  3. Select "SDK as Network Type" and give your custom network a name.

  4. Enter the class name "com.applovin.mediation.adapters.HuaweiMediationAdapter" for Android/FireOS Adapter Class Name.

  5. Enter "HuaweiMediationAdapter" for iOS Adapter Class Name

  6. Go to "Ad Units" tab, and create a new ad unit or modify the existing one.

  7. On "Default Waterfall" section below the "Custom Networks & Deals" enable the Huawei network.

  8. Enter the Huawei Ad unit ID for Placement ID and Enter CPM price for the waterfall.

    Note: This link also can be useful.

Integrate the Huawei Mediation SDK

In the project-level build.gradle, include Huawei's Maven repository.

repositories {
    maven { url 'https://developer.huawei.com/repo/' } // Add this line
   
}

...

allprojects {
    repositories {
        maven { url 'https://developer.huawei.com/repo/' } //Add this line
        
    }
}

In the app-level build.gradle, include Huawei Ads dependency (required by the adapter) and the adapter
dependencies {
    implementation 'com.applovin.mediation:huawei-adapter:<latest-version>'
}

Check the latest version of adapter here

Important Note : Applovin-Huawei adapter released and maintained by Applovin team. Please use this repository if you have any issues or feedbacks related to Huawei adapter.

Permissions

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.)

Configuring Obfuscation Scripts

Before building the APK, configure the obfuscation configuration file to prevent the HUAWEI Ads SDK () from being obfuscated.

Open the obfuscation configuration file proguard-rules.pro in the app-level directory of your Android project, and add configurations to exclude the HUAWEI Ads SDK from obfuscation.

-keep class com.huawei.openalliance.ad.** { *; }
-keep class com.huawei.hms.ads.** { *; }

Configuring Network Permissions

To allow HTTP and HTTPS network requests on devices with targetSdkVersion 28 or later, configure the following information in the AndroidManifest.xml file :

<activity
    ...
    android:usesCleartextTraffic="true"
    >
    ...
</activity>

Version Change History

13.4.49.301.3

Banner Ad type fixed.

13.4.49.301.2

Banner and MREC adapter classes are added.

13.4.49.301.1

Interstitial,rewarded and native adapter classes are added.

Platforms

Native

This section demonstrates how to use Applovin mediation feature with Huawei Ads Kit on Native android app.

Firstly, integrate the Applovin-MAX SDK for Android

Applovin-MAX Android SDK can be used for all ad types.

Note :

  1. Developers can find app level build.gradle in their project from "app-folder/app/build.gradle"
  2. If you use the native ad format in your application, please submit a ticket here to get support from Huawei.

Banner Ad

To use Banner ads in Native android apps, please check the Applovin-MAX SDK. Click here to get more information about Applovin-MAX SDKs Banner Ad development.

Interstitial Ad

To use Interstitial ads in Native android apps, please check the Applovin-MAX SDK. Click here to get more information about Applovin-MAX SDKs Interstitial Ad development.

Rewarded Ad

To use Rewarded ads in Native android Rewarded, please check the Applovin-MAX SDK. Click here to get more information about Applovin-MAX SDKs Rewarded Ad development.

Native Ads

To use Native ads in Native android apps, please check the Applovin-MAX SDK. Click here to get more information about Applovin-MAX SDKs Native Ad development.

MREC Ads

To use MREC ads in Native android apps, please check the Applovin-MAX SDK. Click here to get more information about Applovin-MAX SDKs MREC Ad development.

Note: Enter Huawei 300x250 Banner slot ID for Applovin MREC ad type.

Unity

This section demonstrates how to use Applovin mediation feature with Huawei Ads Kit on Unity.

Make sure to check the article on How to use Huawei Ads with Supported Ad Platforms in Unity ? to learn how to implement Huawei Ads in Unity platform.

Supported Ad Formats are: Banner Ads, Interstitial Ads, Rewarded Ads and MREC Ads.

Firstly, integrate the Applovin Unity SDK to Unity.

For more details on Applovin Unity SDK visit here

Banner Ads

To use Banner ads in Unity , please check the Applovin Unity SDK. Click here to get more information about Applovin Unity SDKs Banner Ad development.

Interstitial Ads

To use Interstitial ads in Unity, please check the Applovin Unity SDK. Click here to get more information about Applovin Unity SDKs Interstitial Ad development.

Rewarded Ads

To use Rewarded ads in Unity, please check the Applovin Unity SDK. Click here to get more information about Applovin Unity SDKs Rewarded Ad development.

Medium Rectangle Ads

To use Medium Rectangle ads in Unity , please check the Applovin Unity SDK. Click here to get more information about Applovin Unity SDKs Medium Rectangle Ad development.

Step 1:

Make sure to switch to the Android Platform from Build Settings -> Android -> Switch Platform

Step 2:

Edit -> Project Settings -> Player -> Other Settings
In Other Settings set minimum API level to at least 21.

Step 3:

Edit -> Project Settings -> Player -> Publishing Settings
In Publishing Settings select “Custom Main Gradle Template” , “Custom Base Gradle Template” and “Custom Greadle Properties Template”
This will let you override mainTemplate.gradle , baseProjectTemplate.gradle and gradleTemplate.properties files in the project.

Step 4:

baseProjectTemplate.gradle is equal to project-level gradle so you have to include Huawei's Maven repositories from the Integrate the Huawei Mediation SDK section from here
mainTemplate.gradle is equal to app-level build.gradle so you have to include dependencies from the Integrate the Huawei Mediation SDK section from here.

Step 5:

Open gradleTemplate.properties and add the following lines

android.useAndroidX=true
android.enableJetifier=true

After these configurations is completed you can display Huawei Ads.

Note: In case of any error on aaptOptions you can add the following line to aaptOptions in launcherTemplate.gradle which you override it by enabiling it from Edit -> Project Settings -> Player -> Publishing Settings

aaptOptions {
        noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }

This section demonstrates how to use Applovin mediation feature with Huawei Ads Kit on Unity android app.

Screenshots

Banner Ad

Interstitial Ad

Rewarded Ad

Native Ad

Medium Rectangle Ad

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published