在适用于iOS的Phonegap应用中使用Admob的正确方法

时间:2012-06-30 13:08:55

标签: ios xcode cordova admob

我已经使用Phonegap(Cordova 1.8.1)构建了一个iOS应用程序,现在我正在尝试将admob广告添加到我的应用程序中。如果您知道AdMob现在不允许选择“智能手机网络”,那么可以我只是在index.html中实现JavaScript代码,还是需要使用Admob iOS SDK?(或者只是使用Google AdSense?)

请注意:

We are simplifying our suite of products by transitioning AdMob mobile web publishers to Google AdSense. Starting May 1, 2012 support for mobile web sites on AdMob will be discontinued and you must have a Google AdSense account to monetize mobile web sites. More information is available here.

1 个答案:

答案 0 :(得分:1)

我相信根据他们的服务条款,您必须集成iOS SDK,因为您仍在发布本机应用程序。

使用iOS SDK集成AdMob广告非常简单。在(void)webViewDidFinishLoad:(UIWebView *)theWebView中,您可以添加GADBannerView并按照here列出的集成说明进行操作。

需要记住的一个重要警告是,您必须减小UIWebView的大小才能为广告腾出空间。确保MainViewController是您的RootViewController。