Integrating InMobi in an iPhone app was really easy. Just follow these simple steps.
Step 1 : Account Registration
Start by creating a new InMobi account at the following URL: https://www.inmobi.com/app/registration.html. You can then login and then select the Publisher section using the link at the bottom left in the following screen shot.
Step 2 : App Registration
From there you can register your app by selecting MySites/Apps and then iPhone App from the drop down menu. Just fill up the information by providing your app bundle ID and App Store URL.
Click ‘Continue’ to retrieve your InMobi App ID. You most use this App ID later in your integration of the app.
Step 3 : SDK Download
You can then download the iOS SDK from Publisher Area. Just select ‘iOS SDK’ from the Downloads section on the left.
The InMobi iOS SDK contains the code required to integrate InMobi ads within you iOS application . Carefully read the iOS SDK integration guidelines before your start the integration.
Step 4 : Add InMobi SDK files to project
Add the the following files from the SDK Bundle to your project:
• InMobiAdDelegate.h
• InMobiAdView.h
• InMobiEnumTypes.h
- libInMobi_iOS.a
Step 5 : Add Required iOS Frameworks
You need to add CoreGraphics, CoreLocation and QuartzCore frameworks to your projects as well as UIKit and Foundation frameworks.
Step 6 – Declare InMobiAdDelegate and InMobiAdView instance
Import InMobiAdDelegate.h, InMobiAdView.h and InMobiEnumTypes.h in your UIViewController derivate class .h file. Declare InMobiAdDelegate protocol and an InMobiAdView instance.
Step 7 – AdView Instantiation and Protocol Methods Definition
Add the following code in your UIViewController derivate class (in our case we wanted the banner to appear at the bottom):
- (void)viewDidLoad {
[super viewDidLoad];
self.adView = [InMobiAdView requestAdUnit:INMOBI_AD_UNIT_320x48 withDelegate:self]];
[self.view addSubview:self.adView];
adView.center = CGPointMake(0, 480-48);
[self.adView loadNewAd];
}
- (NSString *)siteId;
{
return @"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";//this should be prefilled.
}
- (UIViewController *)rootViewControllerForAd;
{
return self;
}
replace the siteId by your own InMobi App ID found on the InMobi site.
Step 8 – Test the Integration
That’s it you will now see a nice banner at the bottom of your app which will hopefully generate tons of ads revenues…









