Pangle
- Supported Ad Formats
- Download and Integrate
- Initialize the Pangle SDK
- Set Up Pangle on the MoPub Dashboard
- Set up Express Banner ad size in Pangle UI
- Pass Data to Pangle
- Test an Ad
- Additional Support
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 |
Medium Rectangle | Express Banner |
Interstitial | Full Screen Video |
Rewarded Ad | 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.
iOS Notes
In v3.4.0.0, the Pangle iOS SDK was separated into two SDKs—one for China-based publishers and one for the rest of the world. MoPub will only certify the non-China SDK starting from v3.4.4.3.
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 theandroid.permission.WAKE_LOCK
permission in yourAndroidManifest
. 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 yourAndroidManifest
. 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
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 supports both 300*250
and 320*50
for banner formats.
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
We recommend that you test your Pangle integration using MoPub mediation test mode to verify that the adapter works as expected. Test mode must be set up on both the MoPub side and the Pangle side.
Set Up Test Mode on the MoPub Side
Refer to our Mediation Test Mode article for complete details on using this mode.
Set Up Test Mode on the Pangle Side
The Pangle UI supports test mode, which you can turn on at the Pangle placement level, and which you can target to specific test devices. To ensure that Pangle test ads are delivered only to your test device, add your test device details in the Pangle UI/ Refer to the Pangle documentation about how to add a test device in the Pangle UI.
Early Initialization to Test Advanced Bidding
To test Advanced Bidding, Pangle requires that you initialize the network SDK early (before the MoPub SDK even), and that you initialize it manually, without waiting for the MoPub server to trigger Pangle to initialize. To do this, you must include the Pangle-specific App ID
key in your initialization code for both iOS and Android, as well as for Unity Prefabs.
If your Pangle test environment is under a different App ID
key, then you must update these test keys in your initialization code for iOS, Android, and Unity Prefabs before you test, so that Pangle initializes not only for your production account details, but for your testing account details as well. (This is not a concern if you use the same App ID
for your Pangle production and testing environments.)
Additional Support
For inquiries and support, consult Pangle’s support center.
Last updated March 30, 2021
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.
© 2021 MoPub (a division of Twitter, Inc.)