小编Abh*_*pta的帖子

如何在Phonegap中实现AdMob

我有一个phonegap应用程序,我试图实现Admob.

我正在使用phonegap 1.4.1版,我使用这个网站作为参考:http://iphone.keyvisuals.com/iphonedev/implementing-admob-ads-in-a-phonegap-project-for-ios-no -plugins要求的/

我的代码如下:

(void)webViewDidFinishLoad:(UIWebView *)theWebView
{

bannerView_ = [[GADBannerView alloc]init];
[bannerView_ setDelegate:self];
[bannerView_ setFrame:CGRectMake(0, 0, 320, 50)];

// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
bannerView_.adUnitID = MY_BANNER_UNIT_ID;

// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
bannerView_.rootViewController = self.viewController;
[self.viewController.view addSubview:bannerView_];

// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:[GADRequest …
Run Code Online (Sandbox Code Playgroud)

iphone admob ios cordova

5
推荐指数
1
解决办法
472
查看次数

标签 统计

admob ×1

cordova ×1

ios ×1

iphone ×1