1

Besides, adding the iAd and AdMob code to get banner to appear on screen, is the following code the correct way to set up a shared banner?

In AppDelegate.h

@import GoogleMobileAds;
#import <UIKit/UIKit.h>
#import <iAd/iAd.h>
#import <GoogleMobileAds/GoogleMobileAds.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;

@property(nonatomic, strong) ADBannerView *iAdView;
@property(nonatomic, strong) GADBannerView *adMobView;
@end

AppDelegate.m

#import "AppDelegate.h"
#import <iAd/iAd.h>

@implementation AppDelegate
@synthesize iAdView;
@synthesize adMobView;

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
 iAdView= [[ADBannerView alloc]init];
 return YES;
 }

iPhone6.m

 #import "iPhone6.h"
 #import <iAd/iAd.h>
 #import "AppDelegate.h"

 -(AppDelegate *) appdelegate {
return (AppDelegate *)[[UIApplication sharedApplication] delegate];
 }

-(void)viewDidLoad{

iAdView =[[self appdelegate] iAdView];
}
Jet
  • 555
  • 1
  • 7
  • 19

0 Answers0