I am working on a hybrid application using Phone gap and iOS. I am integrating google admobs into the app.I have a main view controller class where i have implemented google ads. I have created a GADbannner view and added it as a subview to the self.view. This way ads are visible on each page of the application. Below my ads I have a Cordova web view. Now I also have a javascript class in the www folder of the app.I want to hide this banner view from javascript class. How can I do this?
Please find my code of Main View controller with ads integrated:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
self.webView.frame=CGRectMake(0, 90, 320, 370);
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
}
// for iphone
else
{
self.webView.frame=CGRectMake(0, 50, 320, 410);
NSLog(@"page co-ordinates are set");
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
}
self.webView.contentMode=UIViewContentModeScaleAspectFill;
bannerView_.adUnitID = MY_BANNER_UNIT_ID;
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];