Put AdWhirl Ads into Your iPhone App

Monetizing an iPhone app comes in many flavors these days--you don't just need to charge for your app. Today I want to give you a step-by-step guide to getting ads into your application. You will be shocked how easy it is!

When I decided to release a lite ad-supported version of my app, I searched around to find out about ad providers. Luckily, in my search, I happened upon AdWhirl. AdWhirl is not actually an ad provider--instead, they provide an interface to other ad provider networks, allowing you to add one ad API into your app, and get 8 ad providers instantly (including the ability to put in your own ads).

AdWhirl has outstanding step-by-step instructions on their site here. I was trying to incorporate Quattro Wireless into my app and was having some issues, not the least of which was the lack of cut-and-paste of example code. I was searching on example code when I found AdWhirl, which includes Quattro Wireless as a provider. And AdWhirl made it easy for me to set up my ads, so it was a no brainer. [Update--I have received word from Quattro Wireless that they do provide cut and paste code in their developer wiki. My mistake--I guess I did not look in the right place.]

But now, let's look at some code. For my sliding tile game, I used the cocos2d framework. I was worried this would make it hard to incorporate in AdWhirl, but it was no problem at all! Take the steps in the instructions document above, then do a few simple steps to incorporate AdWhirl into your app:

First, I recommend adding a few constants into a common header file:


#define PUBLISHER_ID @"12345678901234567890"
#define SITE_ID @"MyApplication"
#define ADWHIRLAPPKEY @"1234567890abcdef1234567890"



These are the constants needed by the AdWhirl interface.

Include these variables in your scene header file:


ARRollerView *rollerView;
BOOL isPaused;



Next, I went into my main Scene file and put the following at the end of the init method:


rollerView = [ARRollerView requestRollerViewWithDelegate:self];
[ARRollerView startPreFetchingConfigurationDataWithDelegate:self];

rollerView.center = CGPointMake(160, 454);
UIView *myView = [[Director sharedDirector] openGLView];
[myView addSubview:rollerView];

isPaused = FALSE;


This code will begin prefetching data for ads. Also, you will notice I specifically placed the ads at the bottom of the view--that took some trial and error to get it to line up perfectly. isPaused is going to be the notifier to pause the game timer while an ad would be displayed if the user clicks on one during game play.

Now, your scene will need to provide a method to return your app key:


- (NSString*)adWhirlApplicationKey
{
return ADWHIRLAPPKEY; //Return your AdWhirl application key here
}



Also, add these two methods to pause and unpause the game if you have a game timer:


- (void)willDisplayWebViewCanvas {
isPaused = TRUE;
}
- (void)didDismissWebViewCanvas {
isPaused = FALSE;
}



You will also need to add some code in your timer method to pause timing if isPaused is true. For example, I have a tick event, which I bail out of immediately if isPaused is true.

I was also getting bunch of errors until I added a special line in the dealloc, to set the ad delegate to nil before you release it. So don't forget this part!!


-(void)dealloc{

if (rollerView) {
[rollerView setDelegateToNil];
[rollerView release];
}

.
.
.



And that's it! Hopefully using these few code snippets, you can avoid some of the learning I went through and get ads into your apps in less than an hour.

Obviously, you also need to go through the process on the AdWhirl web site to set up the ad providers, etc, but this is pretty simple. There can be some lag time for some of the providers waiting for codes and things to be emailed to you, but it does not take much of your time to submit the requests.

I hope this is a pretty complete overview. If you have questions, please feel free to send me a note. Good luck!!

Get Quality Backlinks Today

In addition to standard PPC, I have spent a lot of time trying to build quality backlinks to my marketing sites. This is a very difficult and time consuming process. Anyone who has tried to drive more traffic to their sites knows...you can spend an hour a day for months before you get any valuable traffic.

But what if you don't want to wait? Well, I have discovered a great resource in AutomaticBacklinks.com. They are easy to use, easy to set up, and deliver high-quality traffic to your site quickly.

AutomaticBacklinks.com is like most of the back link services in that it offers backlinks in trade for either cash or other links. However it differs in terms of its great pricing and the speed with which you will get traffic. I have tried several of these services and tracked the impact to my volume in Google Analytics. Two things that impressed me...that both the volume was higher, but more importantly, that the quality of the traffic seemed much better. The traffic I got from AutomaticBacklinks really seemed to be *reading* my content, not just finding it. That is testament to the fact that these guys have built a better process than their competitors.

If like me you have some sites you want to get into the limelight--there is no faster way to get it that AutomaticBacklinks.com. Give it a try and see if you don't agree!

Ask Uncle Boris, Live in the AppStore

iPhone/iPod Touch application #3, Ask Uncle Boris is live in the AppStore. This app is not very technically challenging, but it was fun to make and helped me learn a few more things about iPhone development. This was my first app using xib files and standard views. No cocos2d was needed for this one. I am however working on a new app that makes extensive use of TileMapAtlas--it is really easy to use and I cannot believe how quickly the app is coming together.

Here is a demo video I made about the app. You can also look at my marketing page for the app, AskUncleBoris.com.