Sample Apps

Android Sample App

Build from source code

Build

iOS Sample App

Install Enterprise Distribution or build from source code

Install Build

Unity Sample App

Build from source code

Build

Overview

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 video

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

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

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