HyprMX Mobile SDK MoPub Adapter
The HyprMX Android MoPub Adapter allows you to integrate HyprMX in your MoPub rewarded, interstitial, and banner waterfalls.
This adapter is compatible with MoPub v5.16.0+.

Upgrade Instructions - HyprMX SDK MoPub adapter version 5.0+ to 6.0.1.0

The 6.0.1.0 version of HyprMX MoPub adapter requires MoPub version 5.16.0+. Ensure the MoPub dependency has been updated accordingly.
In the following example, we're adding MoPub version 5.18.0:
1
dependencies {
2
implementation('com.mopub:mopub-sdk:[email protected]') {
3
transitive = true
4
}
5
}
Copied!
Update the following dependency versions in your app's build.gradle file:
1
dependencies {
2
implementation 'com.hyprmx.android:HyprMX-MoPub:6.0.1.0'
3
}
Copied!
Remove the following repo from your top-level build.gradle dependencies:
1
allprojects {
2
repositories {
3
maven { url "https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master" }
4
}
5
}
Copied!
Add the following repo to your top-level build.gradle dependencies:
1
allprojects {
2
repositories {
3
maven { url "https://hyprmx.jfrog.io/artifactory/hyprmx" }
4
}
5
}
Copied!
Add the following to your SdkConfiguration before you initialize MoPub with the configuration object. See Initialize Custom Ad Networks in the MoPub documentation. The userId is optional and can be set to null.
Kotlin
Java
1
val userId = "Custom User Id" // or null
2
3
SdkConfiguration.Builder("AD_UNIT_ID")
4
.withAdditionalNetwork(HyprMXAdapterConfiguration::class.java.name)
5
.withMediatedNetworkConfiguration( HyprMXAdapterConfiguration::class.java.name, HyprMXConfiguration(distributorId = "YOUR DISTRIBUTOR ID", userId = userId).toMap())
6
.build()
Copied!
1
String userId = "Custom User Id" // or null
2
3
SdkConfiguration sdkConfiguration = new SdkConfiguration.Builder("AD_UNIT_ID")
4
.withAdditionalNetwork(HyprMXAdapterConfiguration.class.getName())
5
.withMediatedNetworkConfiguration(HyprMXAdapterConfiguration.class.getName(),
6
new HyprMXConfiguration("YOUR DISTRIBUTOR ID", userId, null).toMap())
7
.build();
Copied!

Removal - HyprMXMediationSettings:

If your project used HyprMXMediationSettings to set a custom User ID, please remove the use of the HyprMXMediationSettings object, and set your user ID using the Pre-Initialization instructions above.

Setup Instructions

The following section details how to use the Android HyprMX MoPub Adapter. This guide assumes you already have your Gradle-based project up and running in Android Studio with MoPub Mediation.
  • Open your existing application in Android Studio
  • Add the following repo to your top-level build.gradle dependencies:
1
allprojects {
2
repositories {
3
maven { url "https://hyprmx.jfrog.io/artifactory/hyprmx" }
4
}
5
}
Copied!
  • Add the following dependency to your app's build.gradle file:
1
dependencies {
2
implementation 'com.hyprmx.android:HyprMX-MoPub:6.0.1.0'
3
}
Copied!
If you are using gradle build tools prior to 4.0 MoPub recommends adding the following to your gradle.properties file to prevent a build error:
1
android.enableDexingArtifactTransform=false
Copied!
In order to maximize fill rates, we recommend adding the following permissions to the AndroidManifest.xml:
1
<uses-permission android:name="android.permission.VIBRATE" />
Copied!

Integrating HyprMX On The MoPub Dashboard Using Custom Events

You will create a custom native network campaign in the MoPub UI. When setting up your line item, select 'Network' for the 'Type' field and then select 'Custom Native Network' for the 'Network' field. Further instructions for adding a network account can be found here.
Paste the following data as the Custom Event Data:
1
{"distributorID": "Your Distributor ID",
2
"placementName": "Your Placement name"}
Copied!
"Your Distributor ID" needs to contain the value provided by your HyprMX account manager.
For Rewarded Video, paste the following class name as the Custom Event Class:
1
com.mopub.mobileads.HyprMXRewardedVideo
Copied!
For Interstitial, paste the following class name as the Custom Event Class:
1
com.mopub.mobileads.HyprMXInterstitial
Copied!
For Banner, paste the following class name as the Custom Event Class:
1
com.mopub.mobileads.HyprMXBanner
Copied!

Pre-Initialization + Optional User ID

If your app relies on server-to-server callbacks and requires you to set a static user ID that is publisher-defined for Rewarded Video, pass the user ID as instructed below.
Please contact your HyprMX account services representative if you would like to implement a postback.
The user ID should not contain personal information such as an email address, screen name, or Google's Advertising Identifier (GAID).
Add the following to your SdkConfiguration before you initialize MoPub with the configuration object. See Initialize Custom Ad Networks in the MoPub documentation.
Kotlin
Java
1
val userId = "Custom User Id" // or null
2
SdkConfiguration.Builder("AD_UNIT_ID")
3
.withAdditionalNetwork(HyprMXAdapterConfiguration::class.java.name)
4
.withMediatedNetworkConfiguration( HyprMXAdapterConfiguration::class.java.name, HyprMXConfiguration(distributorId = "YOUR DISTRIBUTOR ID", userId = userId).toMap())
5
.build()
Copied!
1
String userId = "Custom User Id" // or null
2
3
SdkConfiguration sdkConfiguration = new SdkConfiguration.Builder("AD_UNIT_ID")
4
.withAdditionalNetwork(HyprMXAdapterConfiguration.class.getName())
5
.withMediatedNetworkConfiguration(HyprMXAdapterConfiguration.class.getName(),
6
new HyprMXConfiguration("YOUR DISTRIBUTOR ID", userId, null).toMap())
7
.build();
Copied!

License

By integrating the HyprMX SDK, you are agreeing to the End User License Agreement.
Last modified 1mo ago