This guide is intended for publishers who are interested in using Google Mobile Ads mediation with Tencent YLH. It walks through the setup of a mediation adapter to work with your current Android app and the configuration of additional settings.
|Tencent YLH Resources|
An Android app with the Google Mobile Ads SDK integrated. (If you don't have one, see Get Started.)
An AdMob account and an ad unit configured with mediation line items.
The following Help Center articles provide background information on mediation:
Add Tencent YLH to your project
Include network adapter and SDK
Download the Tencent YLH SDK and adapter from the links above.
In Android Studio, include the JAR files in your project's
folder. Make sure that your
build.gradle file includes the following:
implementation fileTree(dir: 'libs', include: ['*.jar'])
Configure the AndroidManifest.xml file
AndroidManifest.xml file as instructed in the Tencent YLH
Your app doesn't need to call Tencent YLH directly—the Google Mobile Ads SDK calls the Tencent YLH adapter to fetch ads on your behalf. If you don't wish to specify any additional request parameters, then you're done! The rest of this page details how to provide more information to Tencent YLH.
Initialize your ad object with an Activity instance
In the constructor for a new ad object (for example,
you must pass in an object of type
Context is passed on to other ad networks when using mediation. Some
ad networks require a more restrictive
Context that is of type
and may not be able to serve ads without an
Activity instance. Therefore,
we recommend passing in an
Activity instance when initializing ad objects
to ensure a consistent experience with your mediated ad networks.