Tuesday 23 August 2011

Adwhirl Integration in iphone apps

This Blog describe how to integrate Adwhirl in your project:-
Adwhirl supports iads in ios 3.0 also.
This blog assumes that you have your application key and you have activated your supported networks.

Getting Started :-
First download the Adwhirl sdk from http://code.google.com/p/adwhirl/downloads/list
You will get a folder which contains these folders:-


Now open your project and drag adwhirl and touchJson folder in your project.
After you drag this window will appear dont forget to check copy items options



Do the same thing for adding touchJson folder also 
Now your project will look like:-


Adwhirl contains a lot of adapters network you have to check only those that you want to use.In my case i am using admobs and iAds
Check only those that you want to use:-


After that Add following frameworks:-

UIKit.framework, Foundation.framework and CoreGraphics.framework should be included in your project by default.
● AddressBook.framework
● AudioToolbox.framework 
● AVFoundation.framework
● CoreLocation.framework 
● MapKit.framework
○ weak-linked for OS 2.X support 
● MediaPlayer.framework
● MessageUI.framework 
○ weak-linked for OS 2.X support
● QuartzCore.framework 
● SystemConfiguration.framework 
● iAd.framework
○ required for iAd, weak-linked for OS 3.X support
● libsqlite3.dylib 
● libz.dylib




Now you need to download the sdk for adapter network you are using.That you can download from that ads corresponding site.
I have used Admobs so for that I have downloaded abmobs sdk
Now add that downloaded folder in the same way as added adwhirl folder.



Now You are ready with your whole integration process and you have to add few lines of code now

In your viewController.h file write:-

#import "AdWhirlDelegateProtocol.h"

add AdwhirlDelegate like this @interface AdwhirlSampleViewController : UIViewController <AdWhirlDelegate>

In your viewController.m file write:-

#import "AdWhirlView.h"

these two delegate methods of adwhirl

-(NSString *)adWhirlApplicationKey
{
return @"a98aa6af9bc04aa59d551a862320d062";
}
- (UIViewController *)viewControllerForPresentingModalView
{
return [((AdwhirlSampleAppDelegate *)[[UIApplication sharedApplication] delegate]) viewController];
}

- (void)viewDidLoad {
[super viewDidLoad];
AdWhirlView *awView = [AdWhirlView requestAdWhirlViewWithDelegate:self]; 
[self.view addSubview:awView];

}

1 comment:

  1. Thanks for the nice tutorial.
    But please tell me what is, return [((AdwhirlSampleAppDelegate *)[[UIApplication sharedApplication] delegate]) viewController]; ?

    What should we do here?please explain.

    ReplyDelete