{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"MoPub (iOS)","type":"basic","slug":"hybid-ios-sdk-adapter-for-mopub","excerpt":"","body":"[block:api-header]\n{\n  \"title\": \"MoPub Mediation\"\n}\n[/block]\nTo use **HyBid SDK** directly in MoPub Mediation you will need to integrate the MoPub SDK and the HyBid SDK into your app.\n[block:api-header]\n{\n  \"title\": \"Integrate MoPub SDK\"\n}\n[/block]\n[Download](https://github.com/mopub/mopub-ios-sdk) and install the MoPub iOS SDK as described in the [MoPub Wiki](https://github.com/mopub/mopub-ios-sdk/wiki#download-the-mopub-ios-sdk).\n[block:api-header]\n{\n  \"title\": \"Integrate HyBid SDK\"\n}\n[/block]\nTo integrate the HyBid SDK follow the instruction in the [integration](https://developers.pubnative.net/v3.0/docs/hybid-ios-sdk-hybid-configuration-beta) page.\n[block:api-header]\n{\n  \"title\": \"Integrate The MoPub Adapter\"\n}\n[/block]\nThere are 2 ways that you can install MoPub Adapters into your application;\n[block:api-header]\n{\n  \"title\": \"1. Drag & Drop Adapter Files\"\n}\n[/block]\nTo use the MoPub Adapter in your project, head over to [MoPub HyBid Adapters](https://github.com/pubnative/mopub-hybid-adapters-ios) repository and import all the adapter files to your project.\n[block:api-header]\n{\n  \"title\": \"Swift Integration\"\n}\n[/block]\nTo 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\n[block:api-header]\n{\n  \"title\": \"2. Cocoapods\"\n}\n[/block]\nIf you're using [CocoaPods](https://cocoapods.org), you can add the MoPub adapters to your project using `Podfile`. Check the listed repository for a detailed integration guide for [MoPub HyBid](https://github.com/pubnative/mopub-hybid-adapters-ios) adapters.\n[block:api-header]\n{\n  \"title\": \"Demo App\"\n}\n[/block]\nYou can find a demo app with code samples for this type of integration [here](https://github.com/pubnative/hybid-ios-mopub-mediation-demo).\n[block:api-header]\n{\n  \"title\": \"Set Up Network on MoPub Dashboard\"\n}\n[/block]\nTo set up the HyBid Adapters in the MoPub mediation you need to follow a few steps. \n\nIf you already have an app and ad units created then you can skip those parts.\n[block:api-header]\n{\n  \"title\": \"Create an App\"\n}\n[/block]\nCreate a new app in the MoPub Dashboard\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/36dda36-MoPub-Mediation-Image-1.png\",\n        \"MoPub-Mediation-Image-1.png\",\n        1922,\n        1204,\n        \"#1b9eea\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Create Leaderboard Ad Unit\"\n}\n[/block]\nCreate a new ad unit and set up the format as **Leaderboard (728x90)**\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ae593b1-MoPub-Mediation-Image-16.png\",\n        \"MoPub-Mediation-Image-16.png\",\n        918,\n        357,\n        \"#1a5b8d\"\n      ]\n    }\n  ]\n}\n[/block]\nAfter this step, you will obtain an **Ad Unit Id**. Use this to request ads for this placement.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/b652125-MoPub-Mediation-Image-17.png\",\n        \"MoPub-Mediation-Image-17.png\",\n        617,\n        426,\n        \"#384457\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Create Banner Ad Unit\"\n}\n[/block]\nCreate a new ad unit and set up the format as **Banner (320x50)** \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/1de5c47-MoPub-Mediation-Image-2.png\",\n        \"MoPub-Mediation-Image-2.png\",\n        1780,\n        962,\n        \"#ccd8db\"\n      ]\n    }\n  ]\n}\n[/block]\nAfter this step, you will obtain an **Ad Unit Id**. Use this to request ads for this placement.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/b75c096-MoPub-Mediation-Image-5.png\",\n        \"MoPub-Mediation-Image-5.png\",\n        1252,\n        862,\n        \"#e6f2f6\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Create Medium Ad Unit\"\n}\n[/block]\nCreate a new ad unit and set up the format as **Medium (300x250)** \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/b61d746-MoPub-Mediation-Image-4.png\",\n        \"MoPub-Mediation-Image-4.png\",\n        1710,\n        936,\n        \"#cdd8db\"\n      ]\n    }\n  ]\n}\n[/block]\nAfter this step, you will obtain an **Ad Unit Id.** Use this to request ads for this placement.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/583d492-MoPub-Mediation-Image-5.png\",\n        \"MoPub-Mediation-Image-5.png\",\n        1252,\n        862,\n        \"#e6f2f6\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Create Intersititial Ad Unit\"\n}\n[/block]\nCreate a new ad unit and set up the format as **Fullscreen** \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/bea0eb4-MoPub-Mediation-Image-6.png\",\n        \"MoPub-Mediation-Image-6.png\",\n        1654,\n        972,\n        \"#ccd7dc\"\n      ]\n    }\n  ]\n}\n[/block]\nAfter this step, you will obtain an **Ad Unit Id**. Use this to request ads for this placement.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/860375c-MoPub-Mediation-Image-7.png\",\n        \"MoPub-Mediation-Image-7.png\",\n        1248,\n        864,\n        \"#e6f2f6\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Create Native Ad Unit\"\n}\n[/block]\nCreate a new ad unit and set up the format as **Native**\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/6c643bf-MoPub-Mediation-Image-14.png\",\n        \"MoPub-Mediation-Image-14.png\",\n        1952,\n        1016,\n        \"#eef5f5\"\n      ]\n    }\n  ]\n}\n[/block]\nAfter this step, you will obtain an **Ad Unit Id**. Use this to request ads for this placement.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/767101a-MoPub-Mediation-Image-15.png\",\n        \"MoPub-Mediation-Image-15.png\",\n        1234,\n        848,\n        \"#333c4c\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Create PubNative Mediation Network\"\n}\n[/block]\nGo to the **Networks** tab on the MoPub Dashboard. Select the option to add a new network. Select **Custom SDK Network**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0aa6a56-MoPub-Mediation-Image-8.png\",\n        \"MoPub-Mediation-Image-8.png\",\n        2030,\n        1202,\n        \"#e9f1f3\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/41b471b-MoPub-Mediation-Image-9.png\",\n        \"MoPub-Mediation-Image-9.png\",\n        1984,\n        1286,\n        \"#eff7f8\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/aae02bc-MoPub-Mediation-Image-10.png\",\n        \"MoPub-Mediation-Image-10.png\",\n        2028,\n        1192,\n        \"#edf5f6\"\n      ]\n    }\n  ]\n}\n[/block]\nOn 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.\n\nInsert for each format the following custom event names and params:\n\n* **Custom event for Leaderboard:** `HyBidMoPubMediationLeaderboardCustomEvent`\n* **Custom event for Banner:** `HyBidMoPubMediationBannerCustomEvent`\n* **Custom event for MRect:** `HyBidMoPubMediationMRectCustomEvent`\n* **Custom event for Interstitial:** `HyBidMoPubMediationInterstitialCustomEvent`\n* **Custom event for Rewarded:** `HyBidMoPubMediationRewardedAdCustomEvent`\n* **Custom event for Native:** `HyBidMoPubMediationNativeAdCustomEvent`\n\nParameters to set up:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"pn_app_token\\\": \\\"<YOUR PUBNATIVE APP TOKEN>\\\",\\n    \\\"pn_zone_id\\\": \\\"<YOUR PLACEMENT ZONE ID>\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/9eb54a2-MoPub-Mediation-Image-11.png\",\n        \"MoPub-Mediation-Image-11.png\",\n        1015,\n        668,\n        \"#ecf4f6\"\n      ]\n    }\n  ]\n}\n[/block]\nAfter setting up the network. Activate it for the app in the **Segments** tab in the MoPub Dashboard\n[block:api-header]\n{\n  \"title\": \"Segments\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/21ab356-MoPub-Mediation-Image-12.png\",\n        \"MoPub-Mediation-Image-12.png\",\n        568,\n        227,\n        \"#d0d6db\"\n      ]\n    }\n  ]\n}\n[/block]\nSet up the proper floor eCPM and make sure the network is enabled for all the required Ad units.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/5d7003f-MoPub-Mediation-Image-13.png\",\n        \"MoPub-Mediation-Image-13.png\",\n        1045,\n        467,\n        \"#f0f8f8\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Request Ads\"\n}\n[/block]\nAds should be requested using the regular MoPub process using the generated **Ad Unit Ids**. You can find the instructions in the MoPub [developers page](https://developers.mopub.com/docs/ios/banner/).\n[block:api-header]\n{\n  \"title\": \"Initialization\"\n}\n[/block]\n**Please note**: to complete implementation, the HyBid SDK needs to be initialized. Follow the HyBid integration guide and complete [this step](https://developers.verve.com/v3.0/docs/hybid-ios-sdk-hybid-configuration-beta#initialise-sdk).","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5b1a5f775952df0003e8bc03","project":"574ff4bd3fa1870e00889ba6","version":{"version":"3.0","version_clean":"3.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["574ff4bd3fa1870e00889baa","577278ecdceb570e003a9001","577279865617b117009e643f","577279985617b117009e6440","577279bc8c48e00e00503504","5774fe18605b770e0037be8a","577ce3ad87acf617003c4187","577f8476a77c700e006a6c52","57b486ae0d2b640e00e9d3f5","57b722133d3e620e004ec74b","57bd95f00fe3a00e003e2cc5","57c8349359cd4b0e00b888ef","57c8349b5754fa1700b12242","57cedb0bad483e0e00890239","57cedbe807d7ea0e00e438cc","57d82967156ef72b007ffcd8","58ee353ad1ee2f0f0034a13d","596623221738df00298622a5","59a51730192dba000fc9ca38","59a8129f1e7b26000fa0fb1a","5a0322bf044b6f001c236e36","5a79897c5b6e430030746df6","5a79898c2b2d5f0012cbab63","5ab3b5e3d2d1e2006252a8f2","5b1a43bd678eab0003aa54a4","5b6d95e29d346300038baff3","5c77d3a1e0794000451bced2","5e902519bb65b200466e7957","5f228f5bd6a1cc0024afda30","617a64bcd70d9600121d80de","617a65249ebd96004a95678d"],"_id":"574ff4bd3fa1870e00889ba9","createdAt":"2016-06-02T08:56:29.492Z","project":"574ff4bd3fa1870e00889ba6","releaseDate":"2016-06-02T08:56:29.492Z","__v":31},"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"[PUBLISHER] Mediation","slug":"publisher-mediation","order":4,"from_sync":false,"reference":false,"_id":"617a65249ebd96004a95678d","createdAt":"2021-10-28T08:53:56.862Z","version":"574ff4bd3fa1870e00889ba9","project":"574ff4bd3fa1870e00889ba6","__v":0},"user":"5770fa1ce5a0000e0023c680","createdAt":"2018-06-08T10:50:31.509Z","githubsync":"","__v":0,"parentDoc":null}
[block:api-header] { "title": "MoPub Mediation" } [/block] To use **HyBid SDK** directly in MoPub Mediation you will need to integrate the MoPub SDK and the HyBid SDK into your app. [block:api-header] { "title": "Integrate MoPub SDK" } [/block] [Download](https://github.com/mopub/mopub-ios-sdk) and install the MoPub iOS SDK as described in the [MoPub Wiki](https://github.com/mopub/mopub-ios-sdk/wiki#download-the-mopub-ios-sdk). [block:api-header] { "title": "Integrate HyBid SDK" } [/block] To integrate the HyBid SDK follow the instruction in the [integration](https://developers.pubnative.net/v3.0/docs/hybid-ios-sdk-hybid-configuration-beta) page. [block:api-header] { "title": "Integrate The MoPub Adapter" } [/block] There are 2 ways that you can install MoPub Adapters into your application; [block:api-header] { "title": "1. Drag & Drop Adapter Files" } [/block] To use the MoPub Adapter in your project, head over to [MoPub HyBid Adapters](https://github.com/pubnative/mopub-hybid-adapters-ios) repository and import all the adapter files to your project. [block:api-header] { "title": "Swift Integration" } [/block] 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 [block:api-header] { "title": "2. Cocoapods" } [/block] If you're using [CocoaPods](https://cocoapods.org), you can add the MoPub adapters to your project using `Podfile`. Check the listed repository for a detailed integration guide for [MoPub HyBid](https://github.com/pubnative/mopub-hybid-adapters-ios) adapters. [block:api-header] { "title": "Demo App" } [/block] You can find a demo app with code samples for this type of integration [here](https://github.com/pubnative/hybid-ios-mopub-mediation-demo). [block:api-header] { "title": "Set Up Network on MoPub Dashboard" } [/block] 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. [block:api-header] { "title": "Create an App" } [/block] Create a new app in the MoPub Dashboard [block:image] { "images": [ { "image": [ "https://files.readme.io/36dda36-MoPub-Mediation-Image-1.png", "MoPub-Mediation-Image-1.png", 1922, 1204, "#1b9eea" ] } ] } [/block] [block:api-header] { "title": "Create Leaderboard Ad Unit" } [/block] Create a new ad unit and set up the format as **Leaderboard (728x90)** [block:image] { "images": [ { "image": [ "https://files.readme.io/ae593b1-MoPub-Mediation-Image-16.png", "MoPub-Mediation-Image-16.png", 918, 357, "#1a5b8d" ] } ] } [/block] After this step, you will obtain an **Ad Unit Id**. Use this to request ads for this placement. [block:image] { "images": [ { "image": [ "https://files.readme.io/b652125-MoPub-Mediation-Image-17.png", "MoPub-Mediation-Image-17.png", 617, 426, "#384457" ] } ] } [/block] [block:api-header] { "title": "Create Banner Ad Unit" } [/block] Create a new ad unit and set up the format as **Banner (320x50)** [block:image] { "images": [ { "image": [ "https://files.readme.io/1de5c47-MoPub-Mediation-Image-2.png", "MoPub-Mediation-Image-2.png", 1780, 962, "#ccd8db" ] } ] } [/block] After this step, you will obtain an **Ad Unit Id**. Use this to request ads for this placement. [block:image] { "images": [ { "image": [ "https://files.readme.io/b75c096-MoPub-Mediation-Image-5.png", "MoPub-Mediation-Image-5.png", 1252, 862, "#e6f2f6" ] } ] } [/block] [block:api-header] { "title": "Create Medium Ad Unit" } [/block] Create a new ad unit and set up the format as **Medium (300x250)** [block:image] { "images": [ { "image": [ "https://files.readme.io/b61d746-MoPub-Mediation-Image-4.png", "MoPub-Mediation-Image-4.png", 1710, 936, "#cdd8db" ] } ] } [/block] After this step, you will obtain an **Ad Unit Id.** Use this to request ads for this placement. [block:image] { "images": [ { "image": [ "https://files.readme.io/583d492-MoPub-Mediation-Image-5.png", "MoPub-Mediation-Image-5.png", 1252, 862, "#e6f2f6" ] } ] } [/block] [block:api-header] { "title": "Create Intersititial Ad Unit" } [/block] Create a new ad unit and set up the format as **Fullscreen** [block:image] { "images": [ { "image": [ "https://files.readme.io/bea0eb4-MoPub-Mediation-Image-6.png", "MoPub-Mediation-Image-6.png", 1654, 972, "#ccd7dc" ] } ] } [/block] After this step, you will obtain an **Ad Unit Id**. Use this to request ads for this placement. [block:image] { "images": [ { "image": [ "https://files.readme.io/860375c-MoPub-Mediation-Image-7.png", "MoPub-Mediation-Image-7.png", 1248, 864, "#e6f2f6" ] } ] } [/block] [block:api-header] { "title": "Create Native Ad Unit" } [/block] Create a new ad unit and set up the format as **Native** [block:image] { "images": [ { "image": [ "https://files.readme.io/6c643bf-MoPub-Mediation-Image-14.png", "MoPub-Mediation-Image-14.png", 1952, 1016, "#eef5f5" ] } ] } [/block] After this step, you will obtain an **Ad Unit Id**. Use this to request ads for this placement. [block:image] { "images": [ { "image": [ "https://files.readme.io/767101a-MoPub-Mediation-Image-15.png", "MoPub-Mediation-Image-15.png", 1234, 848, "#333c4c" ] } ] } [/block] [block:api-header] { "title": "Create PubNative Mediation Network" } [/block] Go to the **Networks** tab on the MoPub Dashboard. Select the option to add a new network. Select **Custom SDK Network**. [block:image] { "images": [ { "image": [ "https://files.readme.io/0aa6a56-MoPub-Mediation-Image-8.png", "MoPub-Mediation-Image-8.png", 2030, 1202, "#e9f1f3" ] } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/41b471b-MoPub-Mediation-Image-9.png", "MoPub-Mediation-Image-9.png", 1984, 1286, "#eff7f8" ] } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/aae02bc-MoPub-Mediation-Image-10.png", "MoPub-Mediation-Image-10.png", 2028, 1192, "#edf5f6" ] } ] } [/block] 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: [block:code] { "codes": [ { "code": "{\n \"pn_app_token\": \"<YOUR PUBNATIVE APP TOKEN>\",\n \"pn_zone_id\": \"<YOUR PLACEMENT ZONE ID>\"\n}", "language": "json" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/9eb54a2-MoPub-Mediation-Image-11.png", "MoPub-Mediation-Image-11.png", 1015, 668, "#ecf4f6" ] } ] } [/block] After setting up the network. Activate it for the app in the **Segments** tab in the MoPub Dashboard [block:api-header] { "title": "Segments" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/21ab356-MoPub-Mediation-Image-12.png", "MoPub-Mediation-Image-12.png", 568, 227, "#d0d6db" ] } ] } [/block] Set up the proper floor eCPM and make sure the network is enabled for all the required Ad units. [block:image] { "images": [ { "image": [ "https://files.readme.io/5d7003f-MoPub-Mediation-Image-13.png", "MoPub-Mediation-Image-13.png", 1045, 467, "#f0f8f8" ] } ] } [/block] [block:api-header] { "title": "Request Ads" } [/block] 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](https://developers.mopub.com/docs/ios/banner/). [block:api-header] { "title": "Initialization" } [/block] **Please note**: to complete implementation, the HyBid SDK needs to be initialized. Follow the HyBid integration guide and complete [this step](https://developers.verve.com/v3.0/docs/hybid-ios-sdk-hybid-configuration-beta#initialise-sdk).