AdMob Unity Adapter

Introduction

The HyprMX Unity AdMob Adapter allows you to integrate HyprMX in your AdMob rewarded, interstitial, and banner waterfalls.
This version supports Unity AdMob plugin 6.0.0 and above.
HyprMX-AdMob-Plugin-6.0.1.1.unitypackage
2KB
Binary

Upgrading to 6.0.1.1

HyprMXMediationExtras has been deprecated and removed in HyprMX-AdMob 6.0.1.0.
Please follow the steps below to remove the deprecated classes.
  1. 1.
    Delete the previous HyprMXAdMob plugin from your project.
    • Note: Confirm the following are removed from your project:
      1. 1.
        HyprMXAdMob/Editor/EmbedHyprMXBinary.cs
      2. 2.
        GoogleMobileAds/Api/Mediation/HyprMX/HyprMXMediationExtras.cs
      3. 3.
        Plugins/Android/HyprMX-AdMob-Unity-Extras-release.aar
      4. 4.
        Plugins/iOS/HyprMXAdNetworkExtras.h
      5. 5.
        Plugins/iOS/HyprMXUAdNetworkExtras.h
      6. 6.
        Plugins/iOS/HyprMXUAdNetworkExtras.m
  2. 2.
    Update your iOS Resolver Settings to embed Dynamic Frameworks - see iOS Configuration below.
  3. 3.
    Set your User ID and Consent State using the new HyprMXAdapterConfiguration API below.

Integrating HyprMX In Your Unity Project

The HyprMX Unity Plugin requires CocoaPods version 1.10.0 or newer installed in your development environment.
Recent versions of the GoogleMobileAds plugin may require a newer version of CocoaPods.
  • Download the HyprMX Unity AdMob Adapter Plugin above.
  • Open your existing application in the Unity IDE.
  • Choose Assets > Import Package > Custom Package... to bring up the File Explorer (Windows) or Finder (Mac).
  • Select the HyprMX Unity AdMob Adapter package, and the Import Unity Package dialog box displays with all the items in the package pre-checked and ready to install.
  • If the Play Services Resolver did not automatically resolve the HyprMX dependencies upon import, select Assets > Play Services Resolver > Resolve.

Integrating HyprMX On The AdMob Dashboard Using Custom Events

  1. 1.
    Create your Mediation Group on the AdMob dashboard. If you are integrating Interstitial and Rewarded Video, follow these steps for both.
  2. 2.
    In the Ad Sources section, select Add Custom Event.
  3. 3.
    In the popup, enter HyprMX in the label field and set the default eCPM (e.g. $15.00).
  4. 4.
    Click 'Continue'.
  5. 5.
    Set the "Class Name" using the table below:
    Plugin with New API:
    AdMob Ad Format
    iOS "Class Name"
    Android "Class Name"
    HYPRAdMobRewardedAdapter
    com.hyprmx.android.HyprMXCustomEventRewarded
    HYPRAdMobVideoAdapter
    com.hyprmx.android.HyprMXCustomEventInterstitial
    Banner
    HyprMXCustomEventBanner
    com.hyprmx.android.HyprMXCustomEventBanner
  6. 6.
    In the "Parameter" field, enter the distributor ID and placement name assigned to you by your HyprMX account manager. Note that the keys are case sensitive.
    1
    { "distributorID": "YOUR_DISTRIBUTOR_ID", "placementName": "REWARDED"}
    Copied!
  7. 7.
    Click 'Done' and then 'Save'.

Android Configuration

In order to maximize fill rates, we recommend adding the VIBRATE permissions.
To add the VIBRATE permission, add the following to your AndroidManifest.xml:
1
<uses-permission android:name="android.permission.VIBRATE" />
Copied!

iOS Configuration

  • Configure your iOS Resolver settings to embed Dynamic Frameworks:
    • Open Assets -> External Dependency Manager -> iOS Resolver -> Settings
    • Enable "Always add the main target to Podfile"
  • If you prefer to enable ATS, uncheck the "Allow Downloads over HTTP" checkbox in Player Settings.
  • When the checkbox is unchecked, add the following keys to the exported iOS project's Info.plist:
    • NSAllowsArbitraryLoads
    • NSAllowsArbitraryLoadsForMedia
    • NSAllowsArbitraryLoadsInWebContent

Configuring Privacy Controls

iOS requires that the use of a user's camera, calendar, photo library, idfa, etc. be declared by advertisers in the plist. Add all of the following entries to your app's plist.
1
<key>NSCameraUsageDescription</key>
2
<string>${PRODUCT_NAME} requests write access to the Camera</string>
3
<key>NSCalendarsUsageDescription</key>
4
<string>${PRODUCT_NAME} requests access to the Calendar</string>
5
<key>NSPhotoLibraryUsageDescription</key>
6
<string>${PRODUCT_NAME} requests access to the Photo Library</string>
7
<key>NSPhotoLibraryAddUsageDescription</key>
8
<string>${PRODUCT_NAME} requests write access to the Photo Library</string>
9
<key>NSUserTrackingUsageDescription</key>
10
<string>${PRODUCT_NAME} would like to show you personalized ads</string>
Copied!
Note: Photo Usage and the Photo Add Usage keys are required by the framework to ensure all rich media advertisements are supported.

SKAdNetwork Identifier

The HyprMX 6.0.0+ SDK supports Apple's new SKAdNetwork for Attribution. To add the HyprMX SKAdNetwork ID to your info.plist:
1
<key>SKAdNetworkItems</key>
2
<array>
3
<dict>
4
<key>SKAdNetworkIdentifier</key>
5
<string>nu4557a4je.skadnetwork</string>
6
</dict>
7
...
8
</array>
Copied!
Note: SKAdNetwork Id's are case sensitive. For more information about SKAdNetwork please refer to Apple's documentation.

Optional: User ID

To pass a custom user ID, you can set the value using the HyprMXAdapterConfiguration.SetUserId API.
The User ID must be set once before loading ads, we recommend setting it on before Initializing AdMob.
1
using GoogleMobileAds.Api.Mediation.HyprMX;
2
3
public void Start()
4
{
5
HyprMXAdapterConfiguration.SetUserId("custom user id");
6
// AdMob Initialization
7
MobileAds.Initialize();
8
}
Copied!

Optional: User Consent

HyprMX allows you to set the user's consent status for jurisdictions that require passing consent using the HyprMXAdapterConfiguration.SetHasUserConsent API.
On App launch the HyprMX SDK's Consent value will be Unknown. You can set Declined by calling SetHasUserConsent(false), or Granted with SetHasUserConsent(true) depending on the user's consent collected by your application.
It is recommended to set the consent status once on Start and whenever your User changes their consent status.
1
using GoogleMobileAds.Api.Mediation.HyprMX;
2
3
public void Start()
4
{
5
// User Declined Consent
6
HyprMXAdapterConfiguration.SetHasUserConsent(false);
7
8
// User Granted Consent
9
HyprMXAdapterConfiguration.SetHasUserConsent(true);
10
}
Copied!
By integrating the HyprMX SDK, you are agreeing to the End User License Agreement.
Last modified 1mo ago