To set up an InMobi account:
Note: For apps without a URL, the test mode is enabled by default. Once live, you can click the link to enter the URL on the dashboard as shown below.
Your app is ready to monetize.
Placement Ids are InMobi’s terminology for AdMob’s ad-unit ids. For example, if you are trying to monetize a banner ad unit via InMobi network, you need to create a placement id of type “Banner”.
Refer the following table for successful monetization:
AdMob Ad Unit Type | InMobi Placement Type |
Banner | Banner |
Interstitial | Interstitial |
Rewarded Interstitial | Rewarded Video |
Native | Native Content |
Create, verify and activate your payment profile to make your earning tangible. InMobi follows a payout cycle of 60 days. This means that your earnings for a given month will be credited to you at the end of the 60-day payout cycle. You have the option of receiving your payouts via PayPal or wire transfer/RTGS.
For more information about payment terms, see here.
Your account ID is available in your InMobi account as illustrated in the screenshot below.
Placement ID is under the placements section as illustrated in the screenshot below.
You can configure the reward either on AdMob’s dashboard or on InMobi’s dashboard.
To configure the same on InMobi’s dashboard, choose Use third-party ad network settings.
Fill in the key-value pair for the reward details, which the InMobi SDK will honour once the user completes watching the video. AdMob will in turn pass this back in the reward callback. For example, you could fill in the following reward details:
Key = Coins, Value = 1000
While setting up the rewards on InMobi dashboard, make sure the reward value is in the form of Integer.
Ensure not to change key names on InMobi dashboard when creating a native content placement type on the InMobi dashboard to support a native ad unit on AdMob’s dashboard. This is to ensure that the InMobi integration works seamlessly on native ad formats.
Notes:
shouldRequestMultipleImages
flag for Native Ads in AdMob SDK.getImageOrientation/preferredImageOrientation
flag in AdMob SDK.Integrating the InMobi SDK and the AdMob Adapter is fairly seamless. To get an ad from InMobi, you need to incorporate both InMobi SDK and the Adapter.
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 towards 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 by January 2017, to ensure ads serve on iOS 9 and later versions, you need to follow these steps as a near-term fix:
Info.plist
.
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSExceptionDomains</key> <dict> <key>example.com</key> <dict> <key>NSIncludesSubdomains</key> <true/> </dict> </dict> </dict>
Note: Refrain from using InMobi domains and CDN in the exception list as it will result in errors during the runtime.
Adding the SDK to your Project
Method 1: Integration via Cocoapods (https://cocoapods.org/pods/InMobiSDK)
Follow these steps :
pod init
Podfile
.
pod 'InMobiSDK' Eg. pod ‘InMobiSDK’
pod install
Workspace with pods is created.
Method 2: Integrating the framework directly
Add the following MANDATORY frameworks to your Xcode project:
InMobiSDK.framework
from the downloaded InMobi iOS SDK bundlelibsqlite3.0.tbd
libz.tbd
WebKit.framework
Add
-ObjC
flag to the Other Linker Flags:
-ObjC
flag
Adding the InMobi Adapter to Your Project
Download the adapter from here. Add the InMobi adapter bundle to your Xcode project.
Code Steps
The code steps remain the same as they are for regular AdMob integration for fetching and loading an ad. Use the AdMob account ID to initialize the AdMob SDK and AdMob “ad unit id” to request and fetch an ad.
More Information
You can download the sample code from here.
The latest documentation and code samples for the AdMob SDK are available here.
To ensure AdMob SDK relays the ad request to InMobi for testing:
After performing the steps above, you can test and relay the requests to InMobi SDK for ad loads.
Enable debug logs by adding the following to
didFinishLaunchingWithOptions
method within the app delegate's .m file, as shown below:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Initialize InMobi SDK with your account ID [IMSdk initWithAccountID:@"Insert InMobi account ID here"]; //Set log level to Debug [IMSdk setLogLevel:kIMSDKLogLevelDebug]; // Do your stuff. return YES; }
You can also leverage feedback available on the diagnostics tab on the ad unit and ad request.
Location can be passed using the following method under
GADInMobiExtras.h.
- (void)setLocation:(CLLocation*)location;
All non-context specific parameters can be passed to InMobi for richer ad targeting. Ensure that you pass on the values for the fields, which you collect, and have user consent to share this data. Class
"GADInMobiExtras"
provides methods to set demographic information about the user.
InMobi supports the following parameters:
Method Name | Value | Description |
setAgeGroup |
kIMSDKAgeGroupBelow18 kIMSDKAgeGroupBetween18 And20 kIMSDKAgeGroupBetween21And24 kIMSDKAgeGroupBetween25And34 kIMSDKAgeGroupBetween35And54, kIMSDKAgeGroupAbove55 |
The age group of the user |
setHouseholdIncome |
kIMSDKHouseholdIncomeBelow5kUSD kIMSDKHouseholdIncomeBetweek5kAnd10kUSD, kIMSDKHouseholdIncomeBetween10kAnd15kUSD, kIMSDKHouseholdIncomeBetween15kAnd20kUSD, kIMSDKHouseholdIncomeBetween20kAnd25kUSD, kIMSDKHouseholdIncomeBetween25kAnd50kUSD, kIMSDKHouseholdIncomeBetween50kAnd75kUSD kIMSDKHouseholdIncomeBetween75kAnd100kUSD kIMSDKHouseholdIncomeBetween100kAnd150kUSD, kIMSDKHouseholdIncomeAbove150kUSD |
The house hold income of user in US Dollars |
setEducationType |
kIMSDKEducationHighSchoolOrLess kIMSDKEducationCollegeOrGraduate kIMSDKEducationPostGraduateOrAbove |
The education level
|
setEthnicityType |
kIMSDKEthnicityHispanic, kIMSDKEthnicityCaucasian, kIMSDKEthnicityAsian, kIMSDKEthnicityAfricanAmerican, kIMSDKEthnicityOther |
Ethnic group of the user
|
setIncome |
Integer |
Approximate annual household income (in US Dollars) |
setAge |
Integer |
The age of the user |
setInterests |
Any String |
Any additional relevant description of the user, or their preferences, separated by commas. Valid acceptable values are mentioned below |
setPostalCode |
Any String |
The postal code (usually a 5 digit number) |
setAreaCode |
Any String |
The area code (part of the telephone number) |
setLanguage |
Any String |
The native language of the user (if known) |
setNationality |
Any String |
Nationality of the user |
setLoginId |
Any String |
Indicates a login ID in the publisher’s domain |
setSessionId |
Any String |
Indicates a session ID in the publisher’s domain |
setLocationWithCityStateCountry |
Any String |
Sets location with City, State, Country being passed |
setKeywords |
Any String |
Keywords to be passed in the ad request |
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.