Reputation: 1213
In my app, I want to implement admob and now only I have started to learn about it. So any one please guide me and is there any nice tutorial or sample?
Upvotes: 1
Views: 2218
Reputation: 2449
If you choose to use the Interface Builder approach and follow their steps there is one step missing: Add an AdViewController object to your UIViewController.h/m file and use that as the referencing object in IB. Otherwise you'll get the error:
"Must implement required method -currentViewControllerForAd:(AdMobView *)adView in your delegate"
I realize this is a basic assumption, but it caught me for a minute and i've implemented AdMob 3 times in the past (using different methods, mind you).
Upvotes: 2
Reputation: 8720
Good thing to know, Mike. They also left out one step in Interface Builder. You need to select File's Owner, and drag from Ad View Controller to the new Ad View Object. I simply cannot comprehend why Admob would leave out these details, especially when many new programmers join they're community all the time. They really need help in the documentation & tutorials department.
Upvotes: 1
Reputation: 5177
It's extremely simple. Follow the guide here: http://developer.admob.com/wiki/IPhone#AdMob_iPhone_SDK
Once you have the SDK up, you simply do:
AdMobView *ad = [AdMobView requestAdWithDelegate:<your delegate>]; // start a new ad request
ad.frame = CGRectMake(0, 432, 320, 48); // set the frame, in this case at the bottom of the screen
[self.window addSubview:ad]; // attach the ad to the view hierarchy; self.window is responsible for retaining the ad
Upvotes: 3
Reputation: 10059
Download the Admob SDK for iPhone and look at the example projects. It's very simple.
Upvotes: 2