MoPub Mediation
To use HyBid SDK directly in MoPub Mediation you will need to integrate the MoPub SDK and the HyBid SDK into your app.
Integrate MoPub SDK
Download and install the MoPub iOS SDK as described in the MoPub Wiki.
Integrate HyBid SDK
To integrate the HyBid SDK follow the instruction in the integration page.
Integrate The MoPub Adapter
There are 2 ways that you can install MoPub Adapters into your application;
1. Drag & Drop Adapter Files
To use the MoPub Adapter in your project, head over to MoPub HyBid Adapters repository and import all the adapter files to your project.
Swift Integration
To use the MoPub Adapter in your Swift project, ensure that you have a Bridging Header file in your project and the Objective-C Bridging Header build setting under Swift Compiler - Code Generation has a path to the header
2. Cocoapods
If you're using CocoaPods, you can add the MoPub adapters to your project using Podfile
. Check the listed repository for a detailed integration guide for MoPub HyBid adapters.
Demo App
You can find a demo app with code samples for this type of integration here.
Set Up Network on MoPub Dashboard
To set up the HyBid Adapters in the MoPub mediation you need to follow a few steps.
If you already have an app and ad units created then you can skip those parts.
Create an App
Create a new app in the MoPub Dashboard
![MoPub-Mediation-Image-1.png 1922](https://files.readme.io/36dda36-MoPub-Mediation-Image-1.png)
Create Leaderboard Ad Unit
Create a new ad unit and set up the format as Leaderboard (728x90)
![MoPub-Mediation-Image-16.png 918](https://files.readme.io/ae593b1-MoPub-Mediation-Image-16.png)
After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.
![MoPub-Mediation-Image-17.png 617](https://files.readme.io/b652125-MoPub-Mediation-Image-17.png)
Create Banner Ad Unit
Create a new ad unit and set up the format as Banner (320x50)
![MoPub-Mediation-Image-2.png 1780](https://files.readme.io/1de5c47-MoPub-Mediation-Image-2.png)
After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.
![MoPub-Mediation-Image-5.png 1252](https://files.readme.io/b75c096-MoPub-Mediation-Image-5.png)
Create Medium Ad Unit
Create a new ad unit and set up the format as Medium (300x250)
![MoPub-Mediation-Image-4.png 1710](https://files.readme.io/b61d746-MoPub-Mediation-Image-4.png)
After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.
![MoPub-Mediation-Image-5.png 1252](https://files.readme.io/583d492-MoPub-Mediation-Image-5.png)
Create Intersititial Ad Unit
Create a new ad unit and set up the format as Fullscreen
![MoPub-Mediation-Image-6.png 1654](https://files.readme.io/bea0eb4-MoPub-Mediation-Image-6.png)
After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.
![MoPub-Mediation-Image-7.png 1248](https://files.readme.io/860375c-MoPub-Mediation-Image-7.png)
Create Native Ad Unit
Create a new ad unit and set up the format as Native
![MoPub-Mediation-Image-14.png 1952](https://files.readme.io/6c643bf-MoPub-Mediation-Image-14.png)
After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.
![MoPub-Mediation-Image-15.png 1234](https://files.readme.io/767101a-MoPub-Mediation-Image-15.png)
Create PubNative Mediation Network
Go to the Networks tab on the MoPub Dashboard. Select the option to add a new network. Select Custom SDK Network.
![MoPub-Mediation-Image-8.png 2030](https://files.readme.io/0aa6a56-MoPub-Mediation-Image-8.png)
![MoPub-Mediation-Image-9.png 1984](https://files.readme.io/41b471b-MoPub-Mediation-Image-9.png)
![MoPub-Mediation-Image-10.png 2028](https://files.readme.io/aae02bc-MoPub-Mediation-Image-10.png)
On the App and Ad Unit setup section of the network creation dialog, navigate the list of app all the way to the app and ad units where you want to set up HyBid adapters.
Insert for each format the following custom event names and params:
- Custom event for Leaderboard:
HyBidMoPubMediationLeaderboardCustomEvent
- Custom event for Banner:
HyBidMoPubMediationBannerCustomEvent
- Custom event for MRect:
HyBidMoPubMediationMRectCustomEvent
- Custom event for Interstitial:
HyBidMoPubMediationInterstitialCustomEvent
- Custom event for Rewarded:
HyBidMoPubMediationRewardedAdCustomEvent
- Custom event for Native:
HyBidMoPubMediationNativeAdCustomEvent
Parameters to set up:
{
"pn_app_token": "<YOUR PUBNATIVE APP TOKEN>",
"pn_zone_id": "<YOUR PLACEMENT ZONE ID>"
}
![MoPub-Mediation-Image-11.png 1015](https://files.readme.io/9eb54a2-MoPub-Mediation-Image-11.png)
After setting up the network. Activate it for the app in the Segments tab in the MoPub Dashboard
Segments
![MoPub-Mediation-Image-12.png 568](https://files.readme.io/21ab356-MoPub-Mediation-Image-12.png)
Set up the proper floor eCPM and make sure the network is enabled for all the required Ad units.
![MoPub-Mediation-Image-13.png 1045](https://files.readme.io/5d7003f-MoPub-Mediation-Image-13.png)
Request Ads
Ads should be requested using the regular MoPub process using the generated Ad Unit Ids. You can find the instructions in the MoPub developers page.
Initialization
Please note: to complete implementation, the HyBid SDK needs to be initialized. Follow the HyBid integration guide and complete this step.