Pangle: A global platform dedicated to developer growth.|Integration Docs
Knowledge Center

[Android] AdMob Custom Event Adapter for Pangle

NOTICE: Since AdMob v20.6.0 deprecated the custom event interface, in order to avoid problems, if you are using pangle adapter v1.4.3 and below, please use AdMob version below 20.6.0. For details, please refer to the link. If you use AdMob v20.6.0 and above, please update Pangle adapter to 2.0.0 and above ,and update Pangle SDK to v4.6.0.0 and above.

Please set Admob in your app first. We support a brand new configuration to the v46. If you want to use SDK v46, please use adapter version 2.0.0

Setup Pangle Platform

Create a Pangle account

Create an application and placements in Pangle

  • Click Apps -> + Add App to create a app for mediation.



  • You will get an app with its app ID.

Create Ad Placement

  • Click Ad Placements -> + Add Ad Placement to create the placement for mediation.
  • Select the ad's type for your app and finish the create.
  • You will get a placement with its placement ID.

Add Pangle to AdMob's mediation

Create mediation

  • Click Mediation -> CREATE MEDIATION GROUP to create a mediation group.
  • Select the same ad format which created on Pangle side.
  • After select the ad unit you created on AdMob which you want to embed mediation, click ADD CUSTOM EVENT to set with Pangle.

Set Class Name and Parameter

Set Class Name and Parameter in the mediation setting.

If you use SDK v46 and above:(recommended)

If you use SDK v45 and below:

Class Name

  • If you use SDK v46 and above:(recommended)
    •   Fill com.google.ads.mediation.pangle.customevent.PangleCustomEvent directly in the Admob platform.
  • If you use SDK v45 and below:
    • If you are using gradle to integrate our adapters, please copy the contents below to Class Name .
    • Ad TypeClass Name
      • Reward Video Ads: com.google.ads.mediation.sample.customevent.adapter.AdmobRewardVideoAdapter
      • Interstitial Ads: com.google.ads.mediation.sample.customevent.adapter.AdmobFullScreenVideoAdapter
      • Banner Ads: com.google.ads.mediation.sample.customevent.adapter.AdmobTemplateBannerAdapter
      • Native Ads: com.google.ads.mediation.sample.customevent.adapter.AdmobNativeFeedAdAdapter
    • Otherwise, if you are integrating our adapters by manual, please add adapter's package + adapter'class name to Class Name.
    • Ad Typeadapter'class name (need add package of your app )
      • Reward Video Ads: AdmobRewardVideoAdapter
      • Interstitial Ads: AdmobFullScreenVideoAdapter
      • Banner Ads: AdmobTemplateBannerAdapter
      • Native Ads: AdmobNativeFeedAdAdapter
    • for example, com.bytedance.pangle.admob.adapter.demo.pangle.adapter.AdmobRewardVideoAdapter

Parameter

  • If you use SDK v46 and above:(recommended)
  • If you use SDK v45 and below:
    •   Add {"placementID":"your slot ID"} to Parameter.
    • Parameter: Add {"placementID":"your placement ID on Pangle"} to Parameter , for example,{"placementID":"1234567"}
    • Please make sure to use JSON to set Parameter. Or you need to customize adapter yourself.

Initialize Pangle SDK and Adapter

Import and initialize Pangle SDK

Add url 'https://artifact.bytedance.com/repository/pangle' maven in the allprojects section of your project-level build.gradle.

Next, open the app-level build.gradle file for your app, add implementation 'com.pangle.global:ads-sdk:x.x.x.x' in "dependencies" section. In order to use the Android Advertising ID, we also recommend add com.google.android.gms:play-services-ads-identifier.

Add the following permissions and provider to your app's AndroidManifest.xml.

Please make sure to add provider or ad loading will not work properly.

  • Warning: TTMultiProvider needs to be removed starting from v4.1.0.0 sdk, otherwise it will cause packaging failure
  • Tips: WAKE_LOCK permission is no longer required in version 4.2.5.2 and above

Initialize Pangle SDK asynchronously is supported since the v3.5.0.0 SDK, please call TTAdSdk.init(final Context var0, final TTAdConfig var1, final TTAdSdk.InitCallback var2) to initialize the SDK before you send any ad requests. init only need to be called once per app’s lifecycle, we strongly recommend to do this on app launch.

TTAdSdk.InitCallback will be informed about the result of the initialize.

If you use TextureView for video ads and use SDK v4.3.0.0 and below, please set useTextureView(true) in the Builder and add WAKE_LOCK permission to the manifest.

If you use SDK v46 and above:(recommended)

If you use SDK v45 and below:

You also could check the initialization status with the following method

Please refer to Integrate Pangle SDK and Initialize Pangle SDK for manual integration and more information.

Embed Pangle Adapters

Gradle (preferred)

From our adapter v2.0.0, we support gradle integration.

Please open the app-level build.gradle file for your app, add implementation 'com.pangle.global:adapter-for-admob:2.0.0' in "dependencies" section.

Manual download

  • Click SDK Integration -> SDK download, you can download adapters for different ad formats from your Pangle platform.

Please unzip the file and add adapter files from Android folder into your application project. They can be used with no code changes. Also you can customize it for your use case.

Demo

  • You can find simple use cases from Demo.