Moloco SDK Android

Moloco SDK allows you to load and render any ad (VAST, MRAID, Static HTML)

Release Notes

3.9.0 (April 2025)

  • Fix MRAID audio controls

3.8.0 (March 2025)

  • Breaking change to the error code for ad creation. Now returns UNABLE_TO_CREATE_AD instead of INVALID_AD_UNIT_ID

  • Improvements to Video Player, where the video may have gotten stretched

  • NativeAds no longer crash when used inside a Dialog

3.7.2 (March 2025)

  • Critical bug fix for Android 5.x

3.7.1 (February 2025)

  • Performance improvements

3.7.0 (February 2025)

  • Migrated banner implementation from Jetpack Compose to standard Android Views, enhancing compatibility with traditional Activity-based screens. This change ensures better integration when the parent activity is a standard Activity rather than a ComponentActivity.

  • Performance improvements for fullscreen ads

  • Verified tablet support

  • Fixed ClassCastException in MolocoPrivacy

  • Fixed MRAID rewarded video crash

3.6.1 (January 2025)

  • Critical bug fix

3.6.0 (January 2025)

  • Native Ads and other UI improvements

  • Bug fixes, including crash resolutions

  • SDK size reduction

How to use

Make sure to initialize SDK first. To do so, you need to provide a com.moloco.sdk.publisher.MolocoInitParams which includes:

  1. Context - Android Context

  2. appKey - Identifier of the publisher app registered with Moloco

  3. MediationInfo - To perform the appropriate initialization for the mediation partner

After a successful initialization, now you can create an ad instance of your choice:

Guidelines and samples for created ad instances in the previous step:

Retrieving Bid Token from the SDK:

  1. The API can be called before SDK initialization but needs to be called before each bid request

  2. call Moloco.getBidToken() before each bid request.

    • The API is safe to be called from any thread and preferably should be called from the non-UI thread

  3. The bid token and error (optional) will be returned in the callback of MolocoBidTokenListener

  4. The bid token can be used to make a bid request to the Moloco server. A few considerations when passing bid token:

    • bidToken is never null

    • bidToken might be an empty string when Moloco in non-bid-token mode; or when error returned in the callback is not null

    • error, when present, means: bidToken is an invalid one. Use error data for tracking/logging purposes

    • Important: bidToken should still be passed to the bid request regardless of error presence.

Setting the Privacy information in the SDK

  1. Official adapters will need to update Moloco SDK with privacy information.

  2. In order to use Privacy API, Moloco SDK must be initialized

  3. Call MolocoPrivacy.setPrivacy() to set the privacy information. The API can be called from any thread

     MolocoPrivacy.setPrivacy(
MolocoPrivacy.PrivacySettings(
isUserConsent = true,
isAgeRestrictedUser = false,
isDoNotSell = false
)
)

Error Codes

Packages

Link copied to clipboard

Here reside all the Public APIs of Moloco SDK

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard