How to use Huawei Ads with AdMob mediation (Cordova)

Enes Özdemir
Huawei Developers
Published in
2 min readMar 9, 2021

--

In this article, we will talk about how to obtain Huawei ads in AdMob in Cordova applications. Make sure you have successfully completed the Huawei -AdMob mediation creation part before starting the integration.

We will need the AdMob Cordova SDK to integrate AdMob into our app. But there is no official Cordova SDK for AdMob, therefore third party SDKs has been used in the article.

admob-plus will be used for integration AdMob into Cordova. Other SDK’s can be used for this integration.

Add AdMob Cordova SDK mentioned above to your project.

You can use sample codes in here .

With the sample code you can show banner ad and interstitial ads.

After Admob successfully works with sample project it’s time to implement Huawei ads.

Open your project-level gradle file and include Huawei’s maven repository;

Then open your app-level build gradle, include Huawei Ads dependency (required by the adapter) and the Huawei mediation adapter;

If your app can run only on Huawei mobile phones, you can integrate the Huawei Ads Lite SDK (Optional)

After successfully adding Huawei Ads kit and Huawei mediation adapter to your project replace AdMob ad Unit Ids with Huawei ad unit Ids.

After replacing adUnitId’s with Huawei adUnitId Huawei ads will be displayed.

Rewarded Ad

Rewarded ads are not supported with this SDK. To use Rewarded ads in Cordova app, please check the HMS Core Ads Kit Cordova SDK. Click here to get more information about HMS Core Cordova SDKs Rewarded Ad development.

Native Ad

Native ads are not supported in Cordova. To use Native Ads in Cordova App please check the HMS Core Ads Kit Cordova SDK. Click here to get more information about HMS Core Cordova SDK Native Ad development.

Summary

In this article, we learned how to use AdMob-Huawei mediation adapter in Cordova. Even if you use AdMob or other Mobile Ad Networks, you can increase your revenue by using Huawei Ads in your app.

Thank you.

References

Admob Plus SDK

Huawei Ads Kit

Huawei Ads with AdMob Mediation Article

--

--