Pangle

If you plan to use the MoPub SDK to load and display ads from Pangle via mediation, use this article for integration instructions and information unique to the ad network. To learn more about how MoPub mediation works, refer to our MoPub Network Mediation article.

Supported Ad Formats

Pangle currently supports the following ad formats. For support information, visit the Pangle homepage.

MoPub Formats Pangle Ad Formats
Banner Express Banner
Interstitial Full Screen Video
Rewarded Video Rewarded Video
Native Native

Download and Integrate

To download the Pangle adapters, navigate to the Mediation Integration Tool. For the latest download and integration instructions, consult Pangle’s tutorials before you integrate the SDK and adapters.

Android Notes

  • Android Proguard: If you use Proguard to obfuscate your code, do not obfuscate the Pangle SDK code. Add the following configuration to your proguard.cfg file (or other obfuscated files):

     -keep public class com.bytedance.sdk.openadsdk.*{ public *; }
    
  • Android Permission: For video ads to work in Pangle Ad TextureView, declare the android.permission.WAKE_LOCK permission in your AndroidManifest. If you integrate the adapters via JCenter dependencies, you can skip this step, because the permission has already been included in the adapter AAR.

        <uses-permission android:name="android.permission.WAKE_LOCK" />
    
  • Android Provider: Pangle uses TTMultiProvider to collect the Google Advertising ID in the SDK. Add the following provider inside the <application> tag of your AndroidManifest. If you integrate the adapters via JCenter dependencies, you can skip this step, because the provider has already been included in the adapter AAR.

        <provider
           android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider"
           android:authorities="${applicationId}.TTMultiProvider"
           android:exported="false"/>
    

Initialize the Pangle SDK

Publishers mediating Pangle must pass their Pangle App ID to SDK configuration when initializing MoPub SDK. You can refer to Pangle documentation for passing more information in SDK.

Note: You need to do this if you are using MoPub 5.13.+ SDK. For 5.14.0 or newer, this step would become optional.

  • For Android:

     Map<String, String> pangleConfig = new HashMap<>();
     pangleConfig.put("app_id", "PANGLE_APP_ID");
     
     SdkConfiguration sdkConfiguration = new SdkConfiguration.Builder("AD_UNIT_ID")
                                         .withAdditionalNetwork(PangleAdapterConfiguration.class.getName())
                                         .withMediatedNetworkConfiguration(PangleAdapterConfiguration.class.getName(), pangleConfig)
                                         .build();
     MoPub.initializeSdk(this, sdkConfiguration, initSdkListener());
    
  • For iOS:

     MPMoPubConfiguration *sdkConfig = [[MPMoPubConfiguration alloc] initWithAdUnitIdForAppInitialization:@"AD_UNIT_ID"];
     
     NSMutableDictionary *pangleConfig = [NSMutableDictionary new];
     [pangleConfig setObject:@"YOUR_PANGLE_APP_ID" forKey:@"app_id"];
     
     sdkConfig.additionalNetworks = @[PangleAdapterConfiguration.class];
     sdkConfig.mediatedNetworkConfigurations = [@{@"PangleAdapterConfiguration":pangleConfig} mutableCopy];
     
     [[MoPub sharedInstance] initializeSdkWithConfiguration:sdkConfig completion:^{
           NSLog(@"SDK initialization complete");
     }];
    
  • For Unity:

    • Using MoPub Manager Prefab To Auto Initialize Ensure you attach Pangle Network Configuration script to your MoPub Manager Prefab, enable the script, and populate the app_id information. Please see the “Network Configuration (Mediation)” topic here for an example.

    • Manual Initialization:

        MoPub.InitializeSdk(new MoPub.SdkConfiguration {
                // Define the Pangle app_id you want to initialize with
              MediatedNetworks = new MoPub.MediatedNetwork[]
              {
                  new MoPub.MediatedNetwork
                  {
                      // Specify the class name that implements the AdapterConfiguration interface.
                    #if UNITY_ANDROID
                       AdapterConfigurationClassName = "com.mopub.mobileads.PangleAdapterConfiguration", 
                    #else // UNITY_IOS
                       AdapterConfigurationClassName = "PangleAdapterConfiguration",
                    #endif
      
                    NetworkConfiguration = new Dictionary<string, string> {
                          { "app_id", "YOUR_PANGLE_APP_ID" },
                    },
                  }
              },
          });
      

Set Up Pangle on the MoPub Dashboard

App ID and Ad Placement ID are required.

Set up Express Banner ad size in Pangle UI

Pangle Banner Ad Size

To ensure the best UX when showing the banner ads, make sure to select the correct size ratio on the Pangle UI with the Express Native type. The banner ad size is calculated by dividing the size number selected in Pangle UI by 2.

For example: If you select 600*500 on the Pangle UI, Pangle will support rendering 300*250 ad.

Note: Pangle currently only support 300*250 for banner format.

Pass Data to Pangle

You can pass additional optional data from your app to Pangle by following the instructions below. Supported data fields include reward name, reward amount, user ID, orientation, mediaExtra, and any custom data String. For details about each field, refer to the Pangle documentation.

The PangleAdapterConfiguration class contains public setters for the custom data fields discussed above. In your app, simply call the corresponding setter with the data in order to pass it to the Pangle adapters.

For example, to pass in a reward name, call the following method before you make your ad request.

  • For Android:

       PangleAdapterConfiguration.setRewardName("USD");
    
  • For iOS:

       [PangleAdapterConfiguration setRewardName:@"USD"];
    

Test an Ad

As you test your SDK integrations and network setups, we recommend that you leverage test ad placements to ensure a consistent fill rate. To set up test mode, follow the instructions in Pangle’s testing articles for iOS and Android.

With test mode enabled, you can request ads using the ad unit ID you created earlier for this purpose and receive a Pangle test ad. Be sure to disable test mode after testing!

Additional Support

For inquiries and support, consult Pangle’s support center.

Last updated October 23, 2020

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2020 MoPub (a division of Twitter, Inc.)