添加iPad全屏广告Full-Screen Advertisements

添加iPad全屏广告Full-Screen Advertisements,第1张

概述https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/iAd_Guide/Full-ScreenAdvertisements/Full-ScreenAdvertisements.html#//apple_ref/doc/uid/TP40009881-CH5-SW1 文档已经写的很清楚了, 只支

https://developer.apple.com/library/ios/documentation/UserExperIEnce/Conceptual/iAd_GuIDe/Full-ScreenAdvertisements/Full-ScreenAdvertisements.HTML#//apple_ref/doc/uID/TP40009881-CH5-SW1

文档已经写的很清楚了,只支持ipad

important: Don’t create multiple ad objects at the same time; the time at which an advertisement’s content expires is based in part on when the ad object finishes loading its content. If you create multiple ad objects simultaneously (to create a ready pool of ads),some ads may expire before you can display them.

不要尝试一次创建多个广告对象


important: When your vIEw hosts the advertisement,the ad object adds a subvIEw to your vIEw. Do not attempt to modify this vIEw or add other vIEws to obscure it. While the ad object’s content is presented by your vIEw,you should treat that vIEw’s contents as if it were owned by the ad object. You may change the vIEw’s position within its parent vIEw; this allows you to move the vIEw to a different page in your scroll vIEw

全屏广告可以放到滚动条里面,和其他内容混合在一起


important: If your app was moved into the background because the willLeave parameter was YES,then the app’s user interface is never covered by the banner view and your app does not receive a call to interstitialAdActionDIDFinish:. However,if your interface was covered by the banner view,your app Could still be moved into the background later,either because the advertisement launched another app or because the user chose to do so. In all cases,if your user interface was covered by the banner view,it is uncovered and your delegate’s interstitialAdActionDIDFinish: is invoked before your app moves to the background. Because the app may be moving into the background,your delegate should return quickly from its interstitialAdActionDIDFinish: method.


important: Canceling an advertising action,or preventing an advertising action from executing,can potentially impact the advertisements your app receives,and the revenue you receive through showing advertisements. Your app should cancel the action only when it urgently requires the user’s attention. For example,an app that provIDes Voice over Internet Protocol (VoIP) might cancel an advertisement when the app receives a call from another user


总结下来呢,实际实战需要注意:

1.只支持ipad,不支持iphone,据我的推断是因为iphone的内存占用,因为全屏广告并不是当时加载,而是游戏创建就开始后台跑,如果iphone加入,会十分影响应用体验,苹果这点还是挺良心的,另一个原因也可能是因为苹果那分裂的iphone屏幕比例,造成无法更好的

2.初始化app就需要激活这个广告类,让其后台加载

3.出错后肯定会调用两个响应,一个是错误响应,然后是unload卸载响应,应该是移除内存吧,这时候我做法是释放ad,然后创建,因为这时候已经无效了

3.ad请求是需要判断的,ad.isloaded 才能展示广告,否则会直接蹦错,这时候记得暂停游戏,关掉北京音效

4.在finish响应时,广告已经完全隐藏,这时候调用恢复游戏进程代码,另外广告有可能在展示的过程中出现错误响应, 这时候是不会有finish响应的,官文也只出了,所以这两个地方都要判断来控制游戏进程回复,否则会假死

总结

以上是内存溢出为你收集整理的添加iPad全屏广告Full-Screen Advertisements全部内容,希望文章能够帮你解决添加iPad全屏广告Full-Screen Advertisements所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1088615.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存