AdMob Unity Adapter Plugin
Last updated
Last updated
The HyprMX Unity AdMob Adapter Plugin allows you to integrate HyprMX in your AdMob rewarded, interstitial, and banner/MREC 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 8.0.0 and above.
User ID
has been removed in HyprMX-AdMob 6.4.2.0. Please follow the steps below to remove the configuration.
Remove references to HyprMXAdapterConfiguration.SetUserId("custom user id");
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 all the items in the package pre-checked and ready to install.
If the External Dependency Manager did not automatically resolve the HyprMX dependencies upon import, select Assets > External Dependency Manager > Android Resolver > Resolve.
Create your Mediation Group on the AdMob dashboard. If you are integrating Interstitial and Rewarded Video, follow these steps for both.
In the Ad Sources section, select Add Custom Event
.
In the popup, enter HyprMX
in the label field and set the default eCPM (e.g. $15.00).
Click 'Continue'.
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
HyprMXCustomEventBanner
com.hyprmx.android.HyprMXCustomEventBanner
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.
Click 'Done' and then 'Save'.
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
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:
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.
Note: Photo Usage and the Photo Add Usage keys are required by the framework to ensure all rich media advertisements are supported.
The HyprMX 6.0.0+ SDK supports Apple's new SKAdNetwork for Attribution. To add the HyprMX SKAdNetwork ID to your info.plist:
Note: SKAdNetwork IDs are case-sensitive. For more information about SKAdNetwork please refer to Apple's documentation.
Regional laws and regulations such as COPPA, GDPR, Google Play Store policies, and Apple's Privacy Policy require child-directed treatment of applicable users.
If you participate in Google Play’s Families Program, are listed in Google Play’s Family section, or include children as one of the target audiences, it is your responsibility as the app developer to ensure compliance with regional laws and regulations, and Google Play's Families Program, including, and not limited to, Google Play Families Policies to prevent access to the AAID for end-users flagged as children.
For instructions on how to tag the ad request as child-directed, please follow AdMob's child-directed setting documentation.
HyprMX provides the HyprMXAdapterConfiguration.SetHasUserConsent
API to indicate a user’s consent status. This API will be used to indicate a user’s opt-in or opt-out consent for the collection and use of personal data under applicable laws and jurisdictions (GDPR, CPRA, etc.).
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.
Refer to our Banner/MREC Ads guide (iOS, Android) to learn more about Audio Banner Ads.
To receive audio event callbacks, implement the IHyprMXAudioListener
interface and set your delegate object to HyprMXAudioEventBus.Instance.listener
.
When an Audio Banner Ad begins playing, you will receive an adAudioWillStart
callback from your audioChangeDelegate
. You should use this callback to pause your application's current audio player.
An Audio Banner Ad must remain on screen for the duration of the audio playback. In order to ensure the banner placement is not refreshed until the audio is complete, please set the refresh interval in your mediator's dashboard to 30 seconds or greater.
When an Audio Banner Ad has completed playback, you will receive an adAudioDidEnd
callback from your audioChangeDelegate
. You should use this callback to resume your application's audio player.
By integrating the HyprMX SDK, you are agreeing to the End User License Agreement.