




已阅读5页,还剩4页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Admob iPhone SDK Readme 原创中文翻译参考 App Store上线 推广 销售讨论区 Cocoa China 开发讨论区 最热的Mac开发论坛 最热的iPhone开发论坛 最 11 46 22 上一主题下一主题 使用道具复制链接 推送到博客 浏览器收藏 打印 无图版 左右分栏 风格切换 帮助 Home首页 论坛首页 等级 新手上路 帖子 0 我的主题 我的回复 您还没有设置个性签名 编辑 热门版块 App Store上线 推广 销售讨论区 iPhone开发 iPad开发 一般讨论区 游戏开发讨论区 苹果开发一般讨论区 苹果综合议事大厅 iPhone开发 iPad开发 新手提问区 wz88510731 级别 骑士 a 16yrs Dreamboy in sleepl for appstore 楼主 发表于 13天前 Admob iPhone SDK Readme 原创中文翻译参考 管理提醒 本帖被 superarts 设置为精华 2010 02 12 花了两个通宵写了个iExpress 因为这次是面向中国市场 所以打算进行免费加广 告的模式 因此需要集成Admob了 可是郁闷的是 搜遍了Google也没有相关的集成 方案资料 只好硬着头皮看Admob iPhone SDKReadme了 看CocoaChina里的大大 们都在作品里使用了Admob的广告服务 却没有人来写篇教程 所以就由无聊的小生 我来写吧 首先假设你已经填写了相关资料 并下载了Admob iPhone SDK 下面由小生我来翻 译Readme 只翻译关键部分喔 小生才疏学浅 英语只有初中水平 如有纰漏 还请指证 About AdMob iPhone SDK AdMob ads are displayed in 320 48 UIViews They can be placed anywhere in the main window of your app in a table view on a splash page etc Your implementation of the AdMobDelegate AdMobDelegate Protocol h controls the features of the ad e g color scheme and receives notifications e g the ad has loaded You may display the ad view when you begin requesting an ad or wait until the ad h as loaded successfully see the 只看楼主 小 中 大 讨论区推荐搜索社区服务博客朋友圈 tequila0001 设置 退出 Cocoa China 开发讨论区App Store上线 推广 销售讨论区Admob iPhone SDK Readme 原创中文翻译参考 Admob iPhone SDK Readme 原创中文翻译参考 App Store上线 推广 销售讨论区 Cocoa China 开发讨论区 最热的Mac开发论坛 最热的iPhone开发论坛 最 11 46 22 sample IB controller AdViewController m for an example of how to do this Do not prefetch ads Only request an ad you intend to display or else you will significantly hurt ad optimization and thus nega tively impact your earnings Optionally you may integrate interstitial ads into your application There is no guaran tee interstitials will ever be shown in your application AdMob carefully chooses where and when interstitials are run Currently interstitial ads are only enabled for a small set of publishers Interstitial ads will only be returned to those publishers who have prior approval from AdMob We hope to offer this type of ad to more publishers soon Inte rstitials usually run when an application starts between levels in a game or before a movie is played Integration instructions 集成说明 1 Add the AdMob library code and headers to your project They are contained in t he AdMob subdirectory There are four files in all AdMobDelegateProtocol h AdMobView h libAdMobDevice a libAdMobSi mulator a If you are using Objective C you may need a non thumb build of libAdMobDevice a instead which canbe found i n the extras directory called libAdMobDeviceNoThumb a 1 添加Admob的头和代码文件到你的工程 它们包含在Admob这个子文件夹里 这里 有四个文件 分别是AdMobView h libAdMobDevice a libAdMobSimulator a 如果你使 用Objective C 你可能需要使用一个non thumb的libAdmobDevice a编译版本来代 替原来的libAdmobDevice a 你可以从extras这个子文件夹里找到它 它的名字是libA dMobDeviceNoThumb a a Please note that there are two versions of the AdMob libraries one built for use when targeting iPhone 3 x and one built for use when targeting iPhone 2 x If you are targeting only 3 0 devices please use the libraries included in the extras folder Rename the libraries by removing 3 0 from them a 请注意 这里有两个版本的AdMoblibraries 一个编译版本在iPhone 3 x下使用 另一个编译版本在iPhone 2 x下使用 如果你只在iPhone OS3 0的设备下使用 请使 用在extras子文件夹下的编译版本 然后移除它们文件名中的 3 0 标记 译者注 如果你使用sdk3 0编译的话 使用在extras下的库文件 并将相应的文件改 Admob iPhone SDK Readme 原创中文翻译参考 App Store上线 推广 销售讨论区 Cocoa China 开发讨论区 最热的Mac开发论坛 最热的iPhone开发论坛 最 11 46 22 名 如libAdMobDevice3 0 a更名为libAdMobDevice a 然后把它们添加到工程里 F orexample 如果使用objective c 而且还在sdk3 0下编译 则需要使用libAdMobDev iceNoThumb3 0 a更名成libAdMobDevice a来代替原来Admob文件夹下的libAdMobD evice a 另如libAdMobSimulator a也同理 2 Add the CoreLocation CoreGraphics QuartzCore AddressBook AudioToolbox and MediaPlayer frameworks to your project They are required to compile They are dynamic libraries so they won t increase the size of your app You can decline to request location information in your delegate meaning location will not be used b ut it is still required to compile The AddressBook framework will never be used to pull information from a user s address book only to allow the user to add a contact with user confirmation from an advertiser 2 添加CoreLocation CoreGraphics QuartzCore AddressBook AudioToolbox 以及 MediaPlayer frameworks到工程文件中 它们是编译所必须的 这些dynamiclibraries 动态链接库 不会增大你应用的体积 你可以在代理 delegate 中告知地理位置信息不 被使用以拒绝请求地理位置信息 但是它们仍然需要被编译 AddressBookframework 不会被用于搜集用户的通讯录信息 只被允许用户从广告主那里添加联系信息 在你的 用户许可的情况下 a If using the 3 0 libraries add the MessageUI framework as well a 如果使用3 0版本的libraries 最好添加MessageUI framework 3 Get a publisher id from Be sure to set your publisher id correct ly in your delegate If you are using the IBSupport files or running one of the sample projects your publisher id should b e pre filled for you 3 得到一个publisher id 发布者 id 从 确信你的发布者id在你的代 理中是正确的 如果你使用了IBSupport文件或者运行了一个实例工程 你的发布者id 将会预先填入 译者注 在你的代理中 4 Integrate AdMob ads with your app We ve included sample projects showing su per simple integration in three styles 在你的应用中集成Admob 我们有一个实例工程 用三种风格来演示超级简单的集成 方法 Here is sample code extracted for those three styles 这里有三种风格的实例代码 Admob iPhone SDK Readme 原创中文翻译参考 App Store上线 推广 销售讨论区 Cocoa China 开发讨论区 最热的Mac开发论坛 最热的iPhone开发论坛 最 11 46 22 a Add an ad to a view using Interface Builder a 方法一 使用Interface Builder添加你的广告到一个view里 Add AdViewController h and AdViewController m to your project located in the IBS upport subdirectory 添加 AdViewController h 和 AdViewController m 到你的工程里 它们在IBSupport这 个子文件夹里 Open Interface Builder 打开 Interface Builder Place a 320 48 UIView where you want the ad to appear 在你希望显示广告的地方 创建一个320 48大小的UIView 译者注 创建一个UIView然后拖到nib文件里就行了 Add an Object and change its type to AdViewController 添加一个对象 Object 并将它的类型设置为AdViewController 译者注 实际上就是添加一个AdViewController的实例 Set the view outlet of the AdViewController to your UIView 这是AdViewController的view输出口为你的UIView 就是刚才添加的那个View Edit AdViewController m to make sure that your publisher id and other options are set correctly 编辑 AdViewController m 确信你的publisher id 和其他设置是正确的 b Add an ad to a view programmatically b 方法二 通过程式代码的方式将广告添加到view里 Create an AdMob delegate class it can be as simple as a class that only impleme nts publisherId 创建一个AdMob 的代理类 这个是一个简单的代理 只需要实现一个重要的代理 p ublisherid Add the following code to your view creation modify as appropriate 添加下面的代码在你的view创建 如 viewDidLoad 时 如需要 可适当修改 AdMobView ad AdMobView requestAdWithDelegate start a new ad request ad frame CGRectMake 0 432 320 48 set the frame in this case at the botto m of the screen self window addSubview ad attach the ad to the view hierarchy self window is r esponsible for retaining the ad pre c Add an ad to a tableview c 方法三 添加广告到你的tableview里 Create an AdMob delegate class it can be as simple as a class that only impleme nts publisherId Admob iPhone SDK Readme 原创中文翻译参考 App Store上线 推广 销售讨论区 Cocoa China 开发讨论区 最热的Mac开发论坛 最热的iPhone开发论坛 最 11 46 22 创建一个AdMob 的代理类 这个是一个简单的代理 只需要实现一个重要的代理 p ublisherid Add to your tableView cellForRowAtIndexPath method modify as appropriate 添加到你的 tableView cellForRowAtIndexPath 里 如需要可 适当修改 cell contentView addSubview AdMobView requestAdWithDelegate pre 5 The A dMob library uses TouchJSON version 1 0 6 May 14 2009 it is compiled into the AdMob SDK We have included the TouchJSON headers in the TouchJSON directory in case you also want to use TouchJSON You can read more about 5 AdMob library使用了版本号为1 0 6的TouchJSON 2009年5月14日 它被编译到 了AdMob SDK中 我们已经包含了TouchJSON的头文件在TouchJSON的文件夹中 万一您也想要使用TouchJSON 你可以在下面这个地址读到更多 TouchJSON at 6 Optionally integrate AdMob interstitial ads Interstitial ad support is included in th e extras folder Currently interstitial ads are only enabled for a small set of publishers Interstitial ads will only be returned to those publishers who have prior approval from AdMob We hope to offer this type of ad to more publi shers soon The InterstitialSample project uses the 3 0 libraries by default Displaying an interstit ial requires programmatically requesting it e g when a game level starts holding onto the result and then showi ng it at the appropriate time e g after the level completes The sample application demonstrates this in detail Speci al note when using AdMob Interstitial Ads in your application please be sure to instantiate a new MPMoviePlayerControlle r each time you play your own application s videos The MPMoviePlayerController s ContentURL changes if a different MPMovie PlayerController is instantiated with a different URL which may occur if AdMob serves a video interstitial ad Please see t he sample code and AdMobInterstitialAd h for implementation tips We have an internal timeout of approximately 5 seconds enforced at the client level You should receive a callback before Admob iPhone SDK Readme 原创中文翻译参考 App Store上线 推广 销售讨论区 Cocoa China 开发讨论区 最热的Mac开发论坛 最热的iPhone开发论坛 最 11 46 22 that timeout but if you do not we will fail the request and continue caching asset re sources less than 10k and not including a video if necessary in the background We recommend using the AdMob SDK s timeout mechanism If you choose to use an additional timeout mechanism we have seen negative performance with time out values below 5 seconds 7 Contact support with bugs questions or feedback or check the wi ki at FAQ Q I think I ve done everything correctly but I m not seeing any ads What s up with t hat A There are a few things to try The first is to request an ad in test mode Add this t o your AdMob delegate BOOL useTestAd return YES If this does not work make sure the AdMobView has been added to the view hierarc hy If the test ad shows up double check that your publisher id is set correctly return N O for the test ad and try again If it still does not work wait 20 minutes It may take some time before all AdMob serv ers recognize your publisher ID If ads still do not appear check whether the included sample projects displays ads If it does you might want to compare your code to the example paying attention to attaching the AdMobView to your view hierarchy that the frame is set correctly and that the delegate is set correctly You can confirm that there are ads available f or your site by logging in to If it still doesn t work email support or check the wi ki at Q I am seeing weird crashes when I click on ads Any ideas why A Likely you are running the 2 0 libraries in the 3 0 simulator This results in unpredi ctable behavior and random crashes Make sure you always use the 2 0 libraries when running any 2 x version in the sim Admob iPhone SDK Readme 原创中文翻译参考 App Store上线 推广 销售讨论区 Cocoa China 开发讨论区 最热的Mac开发论坛 最热的iPhone开发论坛 最 11 46 22 本帖最近评分记录 顶端回复引用收藏 ulator and the 3 0 libraries for any 3 x version in the simulator Q When I get a video interstitial ad in the simulator my simulator orientation goes h aywire Why A When Apple s MPMoviePlayerController takes control of the phone to start playin g a movie it explicitly sets the orientation of the phone to UIInterfaceOrientationLandscapeRight We return the pho ne t
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年制动总泵项目项目投资筹措计划书代可行性研究报告
- 四、日心说与太阳系教学设计-2025-2026学年初中物理苏科版2024八年级下册-苏科版2024
- 《什么是周长(试一试)》(教学设计)-2024-2025学年三年级上册数学北师大版
- 第三课 赵钱孙李源久长说课稿-2023-2024学年小学地方、校本课程辽海版人与社会
- 12 《早睡早起》(教学设计)2023-2024学年统编版道德与法治一年级上册
- 2024秋四年级英语上册 Module 8 Unit 2 Sam is going to ride a horse第4课时说课稿 外研版(三起)
- DB65T 3680-2014 巴州酿酒葡萄标准体系 总则
- 装备制造面试题库及答案
- 专利管家面试题库及答案
- DB65T 3606-2014 白斑狗鱼、河鲈的常用药物使用准则
- 计算机二级WPS考试试题
- 道路桥梁工程CAD制图标准
- 高速铁路桥隧养护维修 课件 1 铁路桥隧维修概述
- 塔吊安拆及检查培训课件
- 前程无忧测评题库及答案
- 保洁员职业技能鉴定考试题库及答案
- 商业银行数据要素价值洞察研究白皮书2023
- DL5000-火力发电厂设计技术规程
- 2024-2030年中国边境经济合作区行业市场发展分析及经验案例与投资趋势研究报告
- 大决战电影赏析课件
- 中药郁金课件
评论
0/150
提交评论