[iphone-adMob]如何为iphone添加admob广告
2010-05-20 13:39
309 查看
SDK Integration instructions
1) 到网站注册,添加广告。之后会有一个admob sdk 下载界面,下载之后,里面有例子和一些文件。到你的工程之后添加如下的文件。AdMobDelegateProtocol.h, AdMobView.h, and libAdMob.a 如果使用objective c++那么需要引用的是这个 libAdMobNoThumb.a (2) AudioToolbox, CoreGraphics, MediaPlayer, and MessageUI, QuartzCore 把以上的framework 添加到工程中。 (3) TouchJSON 也在下载好的sdk里面,也要添加。 (4) 注册好了登陆,你会获得一个admob 的ID (5) 具体的可以看下载好的例子里面,有相关的程序,sample code等。 一共有三种添加到程序中的广告的方法。 A) 使用Interface builder Add AdViewController.h and AdViewController.m to your project (located in the IBSupport subdirectory). Open Interface Builder. Place a 320x48 UIView where you want the ad to appear. Add an Object, and change its type to AdViewController. Set the view outlet of the AdViewController to your UIView. Set the currentViewController outlet of the AdViewController to the UIViewController owning the xib. Edit AdViewController.m to make sure that your publisher ID and other options are set correctly. B) 通过程序进行添加 Create an AdMob delegate class; it can be as simple as a class that only implements -publisherId and -currentViewController . Add the following code to your view creation (modify as appropriate): 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 adC) 在 tableView里面添加一个广告
Create an AdMob delegate class; it can be as simple as a class that only implements -publisherId and -currentViewController.
Add to your -tableView:cellForRowAtIndexPath: method (modify as appropriate):
[cell.contentView addSubview:[AdMobView requestAdWithDelegate:
<your delegate>]];
相关文章推荐
- 如何使用AdMob Pro插件添加横幅广告到PhoneGap应用程序
- 如何添加AdMob广告到现有的Unity3D ios游戏
- IOS 如何在cocos2d Game中添加 AdMob 广告条
- 如何在你的PhoneGap项目添加Admob广告
- iOS 如何在cocos2d Game中添加 AdMob 广告条
- ios开发笔记如何在iphone-and-ipad应用程序添加admob
- 如何在iphone-and-ipad应用程序添加admob
- 如何添加AdMob广告到现有的Unity3D ios游戏
- 如何使用AdMob在PhoneGap应用程序导航库中添加插入式广告
- IOS 如何在cocos2d Game中添加 AdMob 广告条
- IOS 如何在cocos2d Game中添加 AdMob 广告条
- iPhone开发技巧之发布篇(5)— 在程序中添加广告
- 如何在IPhone程序中集成iAd广告
- unity中如何添加apple的广告
- 如何在你的CSDN 博客中添加广告代码(网赚)
- iphone 如何通过指令来添加three20
- 如何在自己开发的android应用中添加广告
- 如何设置直播前添加或插入10秒广告
- 如何在你的CSDN 博客中添加广告代码(网赚)
- 如何在IPhone程序中集成iAd广告