- About Our Sample Apps
- Create an Ad Unit
- Test Mediation
- Simulate ATT
- Simulate GDPR Consent
- Set Device Log Level
- Test Keyword Passing
- Register and Arrange Native Ad Renderers
- View Impression Logs in the Android Sample App
- Android Sample App Privacy Information
About Our Sample Apps
The MoPub Sample App is for anyone who has a stake in how a creative or tag functions in a MoPub-integrated app:
- Publishers and app developers: Use the MoPub Sample App as a reference implementation to troubleshoot possible MoPub-SDK integration issues.
- Demand-side partners: Use the MoPub Sample App as a reference implementation for how all MoPub-integrated inventory will function, so that you can focus on developing the creative that works across various publishers’ apps.
- Rich-media partners: Use the MoPub Sample App for rich-media certifications.
Use our sample app with the understanding that it must be used only for non-revenue-generating, internal testing purposes.
The MoPub Sample app enables you to view and test various ad formats, including:
- Medium rectangles
- Native static and video
- Rewarded ad
You can now also save your own ad unit IDs for testing. Additionally, the sample app is now AndroidX compatible.
Create an Ad Unit
In the sample app, we have created a sample ad unit for each ad unit type. You can also create your own ad units in the sample app for end-to-end testing. To create an ad unit in the sample app:
- Navigate to the Apps tab, click on the sample app, and click New ad unit in the top right corner.
- Select the ad unit type from the drop menu.
- Enter the ad unit ID from your MoPub account.
- In the New ad unit page, enter a name for your ad unit.
- Select Save ad unit.
The ad unit is now listed under its corresponding ad unit type, and is ready to use.
The sample app includes fully integrated network adapters to enable mediation testing. Note that if you are building the sample app using iOS source code, you must run “pod update” from the Canary folder. For Unity, use the SDK manager.
Not all adapter versions are up to date, but you can override the versions in the following folders:
- Unity: Always up to date with the latest versions.
Note that some networks require personal keys:
- AppLovin: requires an SDK Key in
- Google (AdMob & Ad Manager): requires an app ID in
The iOS sample app allows for ATT consent simulation. On iOS 14+ iPhones, the sample app on SDK version 5.14+ presents an ATT prompt on first app open. You can use this to test the affects of both options.
Simulate GDPR Consent
The Android sample app enables GDPR consent simulation. Select the menu bar in the upper left corner, and GDPR simulation options will be available under Privacy (grant consent, revoke consent, etc.).
Set Device Log Level
In the iOS sample app, you can select your desired level of device logging. To do so, click the three-button menu in the top left corner and scroll down to the Console Log Level section. Learn more about log levels here.
Test Keyword Passing
Both the iOS and Android sample apps enable you to test your keyword-targeted line items. Simply enter your targeted keyword or user data keywords under the ad unit ID before loading the ad. Learn more about passing keywords here.
Register and Arrange Native Ad Renderers
Additionally, you can reorder the renderers on the iOS sample app. Register network renderers first. To rearrange native renderers on iOS, swipe left to open the menu bar in the app, scroll down to Native Renderer and select Change Order.
View Impression Logs in the Android Sample App
The Android sample app enables you to view impression logs in JSON format. To view impression logs:
- Select the three-button menu in the top right corner.
- Select Clear logs to clear out the logs.
- Select Impressions to view the logs.
Here, you will find a list of JSON objects with impression log data for all impressions rendered on the sample app. Refer to the image below for all fields available in the logs:
Android Sample App Privacy Information
The Android sample app enables you to check the privacy information of your device and integration settings, including:
- Device advertising ID
- Vendor list version
- GDPR settings
- and more!
To view these settings, click the three-button menu in the top left corner, and select Information under the Privacy section.
How can we make this article better for you?
Last updated August 28, 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.)