AdMob Mediation

Introduction

HyprMX iOS AdMob Adapter allows you to integrate HyprMX in your AdMob rewarded, interstitial, and banner waterfalls.
This adapter is compatible with AdMob 7.69 and above.

Upgrade Instructions 5.0+ to 6.0.1.0

CocoaPods Integration

To integrate HyprMX with CocoaPods, add the following to your Podfile:
pod 'HyprMX-AdMob', '6.0.1.0'
The HyprMX-AdMob Pod requires CocoaPods version 1.10.0 or newer installed in your development environment. (Note: Recent versions of AdMob require 1.10.2).
Please refer to AdMob's Release Notes for the required minimum CocoaPods version required by the Google-Mobile-Ads-SDK Pod.

Manual SDK Installation

Add HyprMX SDK to your Xcode Project
  • Remove HyprMX.framework and all HyprMX adapter files from your project.
  • Find your target's Build Phases tab and open Link Binary with Libraries. If it exists, remove HyprMX.framework from this list.
  • Add the HyprMX.xcframework to the project. Make sure to copy and verify target membership.
  • Find your target's General tab, open Frameworks, Libraries, and Embedded Content and set the HyprMX.xcframework to Embed & Sign.
  • Add the AdMob-Adapter folder to the project. Make sure to copy and verify target membership.
  • Ensure that your ATS (App Transport Security) settings are as described by AdMob.
  • Add or confirm that info.plist contains the required Privacy Keys. For more information, see the Configuring Privacy Controls section below.
  • Optional: Set user consent, as shown below.

iOS 14 Plist Updates

iOS 14 introduced the AppTrackingTransparency framework to allow users control over the use of their Advertising Identifier.
The HyprMX 6.0.0+ SDK requires the NSUserTrackingUsageDescription Plist Key to determine the authorization state.
<key>NSUserTrackingUsageDescription</key>
<string>${PRODUCT_NAME} would like to show you personalized ads</string>
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.
For more information, see the SKAdNetwork and Configuring Privacy Controls sections below.

Deprecated and Removed: HyprMXAdNetworkExtras

The HyprMXAdNetworkExtras class has been removed from the 6.0.0.0 HyprMX-AdMob adapter. If your Application used HyprMXAdNetworkExtras to provide a User ID or Consent Status, you will need to remove use of this Extras class. See the Optional: User ID & Consent section below to provide these parameters using the new HyprMXAdapterConfiguration API.
That's it! You're up and running with the latest version of the HyprMX SDK.

Initial Setup Instructions

This guide assumes you already have the AdMob iOS SDK integrated into your Xcode project.

CocoaPods Integration

  • Install / update CocoaPods to version 1.10.2 or newer.
  • Add the following to your Podfile:
pod 'HyprMX-AdMob', '6.0.1.0'

Manual Integration

Add HyprMX SDK to your Xcode Project
  • Add the HyprMX.xcframework to the project. Make sure to copy and verify target membership. Set the HyprMX.xcframework to Embed and Sign.
  • Add the AdMob-Adapter folder to the project. Make sure to copy and verify target membership.
  • Ensure that your ATS (App Transport Security) settings are as described by AdMob.

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.

Integrating HyprMX On The AdMob Dashboard Using Custom Events

  1. 1.
    Create your Mediation Group on the AdMob Dashboard.
  2. 2.
    In the Ad Sources, select Add Custom Event.
  3. 3.
    In the popup, enter a unique label such as "HyprMX Placement1" in the label field and set the default eCPM (e.g. $15.00).
  4. 4.
    Click Continue.
  5. 5.
    Set the adapter classname:
    AdMob Ad Format
    Class Name
    HYPRAdMobRewardedAdapter
    HYPRAdMobVideoAdapter
    Banner
    HyprMXCustomEventBanner
  6. 6.
    In the parameter field, enter the distributor ID and placement name assigned to you by your HyprMX account manager.
    { "distributorID": "YOUR_DISTRIBUTOR_ID", "placementName": "HyprMX Placement1" }
  7. 7.
    Click 'Done'.

Optional: User ID & Consent

Importing HyprMXAdapterConfiguration

To add a User ID or provide Consent Status to HyprMX, you will need to import the HyprMXAdapterConfiguration header into your project.
Swift
ObjectiveC
// Add the following to your project's Bridging-Header.h
#import "HyprMXAdapterConfiguration.h"
#import "HyprMXAdapterConfiguration.h"

User ID

The userId is a unique identifier supplied by your application and must be static for each user across sessions. The user ID should not contain personal information such as an email address, screen name, or Apple's Advertising Identifier (IDFA).
The User ID must be set once before loading ads with AdMob, we recommend setting it on App Launch.
Swift
Objective-C
HyprMXAdapterConfiguration.setUserId(your_user_id)
[HyprMXAdapterConfiguration setUserId:your_user_id];
Replace your_user_id with your user ID.

Add User Consent State

HyprMX allows you to set the user's consent status for jurisdictions that require passing consent using the +setConsentStatus: API. On App launch the Consent value will be CONSENT_STATUS_UNKNOWN. You can set CONSENT_DECLINED by calling setHasUserConsent(false), or CONSENT_GRANTED with setHasUserConsent(true) depending on the user's consent collected by your application.
It is recommended to set the consent status once on App Launch; and whenever your User changes their consent status.
Swift
Objective-C
HyprMXAdapterConfiguration.setHasUserConsent(false) // Consent is declined
HyprMXAdapterConfiguration.setHasUserConsent(true) // Consent has been granted
[HyprMXAdapterConfiguration setHasUserConsent:NO]; // Consent is declined
[HyprMXAdapterConfiguration setHasUserConsent:YES]; // Consent has been granted

License

By downloading this SDK, you are agreeing to the LICENSE included with the SDK zip.