InMobi is now a supported SDK network on MoPub’s mediation platform and integrating the InMobi SDK is easy. Read this topic to know more about the integration instructions.
You have access to the following ad types from InMobi via MoPub mediation:
Before you start setting up InMobi as a network on the MoPub dashboard, it’s important that you create an InMobi account, complete your payment information, register your app, and configure placements to get monetizing. For more information, see Getting Started.
After you complete the above steps, you can start setting up InMobi as a network on MoPub. Let’s begin!
The latest version of InMobi SDK supports iOS 9 or higher. Also, this version of iOS SDK requires XCode 12 or higher.
On the MoPub UI, navigate to the Networks tab.
Click New Network.
Search for InMobi in the list of SDK Networks, implementation type.
Click InMobi, select your network settings, and save.
Your account ID is available in your InMobi account as shown below.
The Placement ID is present under the Placements section as shown below.
Enter the InMobi Account ID and the Placement ID on the App & ad unit setup of the MoPub dashboard.
Integrating the InMobi SDK into your project is fairly seamless. But before we begin, let’s pause for some checks:
App Transport Security (ATS), a default setting introduced with iOS 9 that mandates apps to make network connections only over TLS version 1.2 and later. Though InMobi is committed to the adoption of HTTPS, the current setup requires our demand partners to support this change and be 100% compliant with all the requirements of ATS.
While we work with our partners progressing towards a secure environment, to ensure ads work on iOS 9 and later versions, you need to follow these steps as a near-term fix:
Disable ATS (Recommended) - to ensure non-secure content from the partners work correctly in your updated apps. To disable ATS flag, add the following code snippet to your app's Info.plist.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Disable ATS with exceptions (Not Recommended) - in case you plan to migrate towards ATS compliance. You can achieve so by allowing secure content from your domains by adding them on the exception list.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>example.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
Refrain from using InMobi domains and CDN in the exception list as it will result in errors during the runtime.
If ATS is not disabled for apps, monetization will be impacted on devices running iOS 9+. The demand ecosystem has yet to migrate to SSL enabled world, causing ads not to render. The ATS disablement will trigger additional App Store review for your app, and requires you to provide justification. A sample of justification for consideration:
For monetization must support serving ads from the advertisers that do not support secure connections.
Apple has introduced privacy settings to access WiFi details from iOS 12 onwards. To boost monetization and relevant user experience we encourage sharing WiFi details for targeted advertising.
Enable Access WiFi Information on your App ID.
Enable Access WiFi Information for your target app from XCode capabilities.
Ensure WiFi Access is added to your App.entitlements file.
For more information on how to integrate with the MoPub SDK and InMobi SDK, check out MoPub’s official documentation page for InMobi here.
Since MoPub-InMobi Adapters don't handle GDPR currently, we suggest you manually pass the consent to InMobi. This is optional and applicable only if you are not relying on MoPub for acquiring consent.
What is a consentObject? - A consentObject
is a dictionary representation of all kinds of consent provided by the publisher to the SDK. The key is mandatory if you wish to monetize traffic from EEA region. You can read further on GDPR regulations here.
Key | Type | Inference |
gdpr_consent | String | A consent string is a series of numbers, which identifies the consent status of an Adtech Vendor.
The string must follow the IAB contracts as mentioned here. |
gdpr_consent_available | String | "true": The user has provided consent to collect and use data.
"false": The user has not provided consent to collect and use data. Any value other than “true” and “false” is invalid and will be treated as a value not provided by the user. The key, gdpr_consent_available can be accessed via string constant IM_GDPR_CONSENT_IAB. |
gdpr | String | Whether or not the request is subjected to GDPR regulations (0 = No, 1 = Yes), omission indicates Unknown. |
As part of the General Data Protection Regulation (“GDPR”) publishers who collect data on their apps, are required to have a legal basis for collecting and processing the personal data of users in the European Economic Area (“EEA”). Ensure that you obtain appropriate consent from the user before making ad requests to InMobi for Europe and indicate the same by following our recommended SDK implementation. Do not pass any demographics information of a user; if you do not have user consent from such user in Europe.
A consentObject has to be provided in every session. SDK does not persist consent, it only keeps the consentObject in memory. If the app is relaunched, SDK will lose the consentObject. Within a session, a consentObject can be updated as below:
[IMSdk updateGDPRConsent:@{<Insert consentObject dictionary here>}];
IMSdk.updateGDPRConsent(<Insert consentObject dictionary here>)
If your app collects location from the user, we recommend passing it up, as impressions with location signals have higher revenue potential. InMobi SDK will automatically pass the location signals if available in the app. If you use location in your app but would like to disable passing location signals to InMobi, then select NO under the “Location Permission” section for your property on the InMobi Customer Interface.
Otherwise, modify the Custom Event class for your ad unit to pass on the data using the InMobi SDK API. For more details, see the sample code for more details.
InMobi supports the following parameters:
Method Name |
Value |
Description |
setAgeGroup: |
kIMSDKAgeGroupBelow18, kIMSDKAgeGroupBetween18And24 kIMSDKAgeGroupBetween25And29 kIMSDKAgeGroupBetween30And34 kIMSDKAgeGroupBetween35And44 kIMSDKAgeGroupBetween45And54 kIMSDKAgeGroupBetween55And65 kIMSDKAgeGroupAbove65 |
The age group of the user |
setLocation: |
CLLocation object |
Here is a sample for setting up the InMobi SDK Demographic params. Publishers are requested to set the values of params as they want:
[IMSDK setAgeGroup:kIMSDKAgeGroupBetween18And24];
[IMSdk setGender:kIMSDKGenderMale];
AVAudioSession. This will help preempt any content interruptions and help address user experience issues upfront. For more information read these Apple documents: Article 1, Article 2.
By installing this SDK update, you agree that your Children Privacy Compliance setting remains accurate or that you will update that setting, whenever there is a change in your app's audience. You may update the app's Children Privacy Compliance settings at https://publisher.inmobi.com/my-inventory/app-and-placements.