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

[Unity] Admob Custom Event for Pangle (Description)

Please set Admob in your app first.

Setup Pangle Platform

Create a Pangle account

Create an application and placements in Pangle

  • Click Apps -> + Add App to create an 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.
add-mediation.png
  • Select the same ad format which created on Pangle side.
ad-format.png
  • After select the ad unit you created on AdMob which you want to embed mediation, click ADD CUSTOM EVENT to set with Pangle.
add-custom-event.png


Set Class Name and Parameter

Set Class Name and Parameter in the mediation setting.

mediation-param.png


Class Name

Copy the contents below to Class Name based on your needs.

Ad Type

Class Name for Android Adapter

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


Ad Type

Class Name for iOS Adapter

Reward Video Ads

BUDAdmob_RewardCustomEventAdapter

Interstitial Ads

BUDAdmob_FullScreenVideoCustomEventAdapter

Banner Ads

BUDAdmob_BannerCustomEventAdapter

Native Ads

BUDAdmob_NativeFeedCustomEventAdapter


Parameter

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 the Parameter. Or you need to customize the adapter yourself.


Import Pangle SDK and Adapter

Download the plugin from the Pangle platform manually, then find PangleAdapterScriptsDependencies.unitypackage, as below:


截屏2021-09-10 上午12.43.11.png

Open your project in the Unity editor, select Assets > Import Package > Custom Package, and find the PangleAdapterScriptsDependencies.unitypackage. Make sure the file is selected, and then click Import.The plugin will help to import Pangle SDK and Adapters automatically from Maven&Cocoa Pod when you export an Android or iOS project.

截屏2021-09-10 上午12.23.13.png


Additional Configuration for Android

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

  • Warning: TTMultiProvider needs to be removed starting from v4.1.0.0 SDK, otherwise it will cause packaging failure

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


Initialize Pangle SDK

Once you finish the steps above, you need to initialize Pangle SDK. For now, you have to initialize Pangle SDK after exporting an Android or iOS project, we would strongly recommend to initialized Pangle SDK on app launch.


Initialize Android SDK

Initialize Pangle Android 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.

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

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

You also could check the initialization status with the method TTAdSdk.isInitSuccess()

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


Initialize iOS SDK

Initialize Pangle with the APP ID as the argument. Unless there is a particular reason, stipulate asUIApplicationDelegate application(_:didFinishLaunchingWithOptions:)

We recommend using asynchronize initialization method + (void)startWithAsyncCompletionHandler:(BUCompletionHandler)completionHandler; to init the SDK, and also set allowModifyAudioSessionSetting to true to not interrupt the background's audio playback.

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

Test with test ads

Now you have finished the integration. If you wanna test your apps, make sure you use test ads rather than live, production ads. The easiest way to load test ads is to use test mode. It's been specially configured to return test ads for every request, and you're free to use it in your own apps while coding, testing, and debugging.

Refer to the How to add a test device? to add your device to the test devices on the Pangle platform.