Sample Apps

Android Sample App

Install from Google Play or build from source code

Install Build

iOS Sample App

Install Enterprise Distribution or build from source code

Install Build

Unity Sample App

Build from source code


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:

  • Banners
  • Medium rectangles
  • Interstitials
  • 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:

  1. Navigate to the Apps tab, click on the sample app, and click New ad unit in the top right corner.
  2. Select the ad unit type from the drop menu.
  3. Enter the ad unit ID from your MoPub account.
  4. In the New ad unit page, enter a name for your ad unit.
  5. Select Save ad unit.

The ad unit is now listed under its corresponding ad unit type, and is ready to use.

Test Mediation

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:

Note that some networks require personal keys:

  • AppLovin: requires an SDK Key in AndroidManifest and Info.plist
  • Google (AdMob & Ad Manager): requires an app ID in AndroidManifest and Info.plist

Simulate ATT

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 ATT

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.).

MoPub Manager

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.

Set Device Log Level

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.

Test Keyword Passing

Register and Arrange Native Ad Renderers

You must register your own native ad renderers, and that includes those for the MoPub Sample App. Refer to our instructions for setting up ad renderers for native ads on Android or iOS.

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.

MoPub Manager

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:

  1. Select the three-button menu in the top right corner.
  2. Select Clear logs to clear out the logs.
  3. 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:

MoPub Manager

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.

Android Sample App Privacy Info 1Android Sample App Privacy Info 2

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.)