Links

AdMob Unity Adapter Plugin

Introduction

The HyprMX Unity AdMob Adapter Plugin allows you to integrate HyprMX in your AdMob rewarded, interstitial, and banner waterfalls.
If you're upgrading from an older version, please refer to the Upgrade Guide. If you're installing the plugin for the first time, please follow our Setup Guide.
This version supports Unity AdMob plugin 7.0.0 and above.
HyprMX-AdMob-Plugin-6.0.3.1.unitypackage
2KB
Binary

Upgrading to 6.0.3.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:
    • HyprMXAdMob/Editor/EmbedHyprMXBinary.cs
    • GoogleMobileAds/Api/Mediation/HyprMX/HyprMXMediationExtras.cs
    • Plugins/Android/HyprMX-AdMob-Unity-Extras-release.aar
    • Plugins/iOS/HyprMXAdNetworkExtras.h
    • Plugins/iOS/HyprMXUAdNetworkExtras.h
    • Plugins/iOS/HyprMXUAdNetworkExtras.m
  2. 2.
    [iOS only] Update your iOS Resolver Settings to embed Dynamic Frameworks. See iOS Configuration below for details.
  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.
1. Download the HyprMX Unity AdMob Adapter Plugin above.
2. Open your existing application in the Unity IDE.
3. Choose Assets > Import Package > Custom Package... to bring up the File Explorer (Windows) or Finder (Mac).
4. 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.
5. If the External Dependency Manager did not automatically resolve the HyprMX dependencies upon import, select Assets > External Dependency Manager > Android 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 adapter 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.
    { "distributorID": "YOUR_DISTRIBUTOR_ID", "placementName": "REWARDED"}
  7. 7.
    Click 'Done' and then 'Save'.

iOS Configuration

1. 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"
2. If you prefer to enable ATS, uncheck the "Allow Downloads over HTTP" checkbox in Player Settings.
3. When the checkbox is unchecked, add the following keys to the exported iOS project's Info.plist:
  • NSAllowsArbitraryLoads
  • NSAllowsArbitraryLoadsForMedia
  • NSAllowsArbitraryLoadsInWebContent

Orientation

HyprMX recommends your app support all orientations globally to maximize ad fill, as HyprMX ads may be shown in any orientation, and our view controller needs your app to support that behavior. You can configure this by selecting all possible orientations in your projects Player Settings -> Resolution and Presentation. For your iOS target, set your Default Orientation to Auto Rotation and select all orientation check boxes:
Please note, this setup does not require that your Game Scene's interface support all orientations. You just have to configure each of the supported orientations on the Screen object when your scene loads:
public void Start()
{
#if UNITY_IOS
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToLandscapeRight = true;
#endif
}

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.
<key>NSCameraUsageDescription</key>
<string>${PRODUCT_NAME} requests write access to the Camera</string>
<key>NSCalendarsUsageDescription</key>
<string>${PRODUCT_NAME} requests access to the Calendar</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>${PRODUCT_NAME} requests access to the Photo Library</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>${PRODUCT_NAME} requests write access to the Photo Library</string>
<key>NSUserTrackingUsageDescription</key>
<string>${PRODUCT_NAME} would like to show you personalized ads</string>
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:
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>nu4557a4je.skadnetwork</string>
</dict>
...
</array>
Note: SKAdNetwork Id's are case sensitive. For more information about SKAdNetwork please refer to Apple's documentation.

Optional: Tag for Child Directed Treatment

Tagging for child directed treatment is recommended for all users within applications that participate in Google Play’s Families Program, are listed in Google Play’s Family section, or include children as one of the target audiences to prevent access to the AAID for end-users flagged as children.
It is the responsibility of the app developer to ensure compliance with Google Play's Families Program, including, and not limited to, Google Play Families Policies.
For instructions on how to tag the ad request as child directed, please follow the AdMob's child-directed setting 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.
using GoogleMobileAds.Api.Mediation.HyprMX;
public void Start()
{
HyprMXAdapterConfiguration.SetUserId("custom user id");
// AdMob Initialization
MobileAds.Initialize();
}

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 CONSENT_STATUS_UNKNOWN. You can set CONSENT_DECLINED by calling SetHasUserConsent(false), or CONSENT_GIVEN 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.
using GoogleMobileAds.Api.Mediation.HyprMX;
public void Start()
{
// User Declined Consent
HyprMXAdapterConfiguration.SetHasUserConsent(false);
// User Granted Consent
HyprMXAdapterConfiguration.SetHasUserConsent(true);
}

License

By integrating the HyprMX SDK, you are agreeing to the End User License Agreement.