From a61927391a9a6a571bdcbaffbf5dbc1f8e9830ad Mon Sep 17 00:00:00 2001 From: Ram Parameswaran Date: Tue, 24 Feb 2015 12:49:59 -0500 Subject: [PATCH] Adding support for Google Mobile Ads iOS 7.0.0 SDK --- unity/source/Assets/Plugins/iOS/GADUBanner.m | 11 ++++------ .../Assets/Plugins/iOS/GADUInterstitial.m | 11 ++++------ .../Assets/Plugins/iOS/GADUObjectCache.m | 2 +- unity/source/Assets/Plugins/iOS/GADURequest.h | 8 ++----- unity/source/Assets/Plugins/iOS/GADURequest.m | 21 +++++++++++-------- 5 files changed, 23 insertions(+), 30 deletions(-) diff --git a/unity/source/Assets/Plugins/iOS/GADUBanner.m b/unity/source/Assets/Plugins/iOS/GADUBanner.m index 84526c5ca..53d2f447d 100644 --- a/unity/source/Assets/Plugins/iOS/GADUBanner.m +++ b/unity/source/Assets/Plugins/iOS/GADUBanner.m @@ -1,15 +1,12 @@ // Copyright 2014 Google Inc. All Rights Reserved. -#import -#import -#import +@import CoreGraphics; +@import Foundation; +@import GoogleMobileAds; +@import UIKit; #import "GADUBanner.h" -#import "GADAdMobExtras.h" -#import "GADAdSize.h" -#import "GADBannerView.h" -#import "GADBannerViewDelegate.h" #import "UnityAppController.h" @interface GADUBanner () diff --git a/unity/source/Assets/Plugins/iOS/GADUInterstitial.m b/unity/source/Assets/Plugins/iOS/GADUInterstitial.m index 15554cae7..037f0aa58 100644 --- a/unity/source/Assets/Plugins/iOS/GADUInterstitial.m +++ b/unity/source/Assets/Plugins/iOS/GADUInterstitial.m @@ -1,15 +1,12 @@ // Copyright 2014 Google Inc. All Rights Reserved. -#import -#import -#import +@import CoreGraphics; +@import Foundation; +@import GoogleMobileAds; +@import UIKit; #import "GADUInterstitial.h" -#import "GADAdMobExtras.h" -#import "GADAdSize.h" -#import "GADInterstitial.h" -#import "GADInterstitialDelegate.h" #import "UnityAppController.h" @interface GADUInterstitial () diff --git a/unity/source/Assets/Plugins/iOS/GADUObjectCache.m b/unity/source/Assets/Plugins/iOS/GADUObjectCache.m index 76a4be7c7..eea7939d8 100644 --- a/unity/source/Assets/Plugins/iOS/GADUObjectCache.m +++ b/unity/source/Assets/Plugins/iOS/GADUObjectCache.m @@ -1,6 +1,6 @@ // Copyright 2014 Google Inc. All Rights Reserved. -#import +@import Foundation; #import "GADUObjectCache.h" diff --git a/unity/source/Assets/Plugins/iOS/GADURequest.h b/unity/source/Assets/Plugins/iOS/GADURequest.h index 2db9ab50b..ec7a90c12 100644 --- a/unity/source/Assets/Plugins/iOS/GADURequest.h +++ b/unity/source/Assets/Plugins/iOS/GADURequest.h @@ -1,11 +1,7 @@ // Copyright 2014 Google Inc. All Rights Reserved. -#import - -#import "GADRequest.h" - -/// Constant to pass to the addTestDevice method to getting test ads on the simulator. -#define GADU_SIMULATOR_ID @"SIMULATOR" +@import Foundation; +@import GoogleMobileAds; /// Genders to help deliver more relevant ads. typedef NS_ENUM(NSInteger, GADUGender) { diff --git a/unity/source/Assets/Plugins/iOS/GADURequest.m b/unity/source/Assets/Plugins/iOS/GADURequest.m index 1e1619bf8..f6688aea9 100644 --- a/unity/source/Assets/Plugins/iOS/GADURequest.m +++ b/unity/source/Assets/Plugins/iOS/GADURequest.m @@ -1,9 +1,8 @@ // Copyright 2014 Google Inc. All Rights Reserved. -#import +@import Foundation; +@import GoogleMobileAds; -#import "GADAdMobExtras.h" -#import "GADRequest.h" #import "GADURequest.h" @implementation GADURequest @@ -18,12 +17,15 @@ - (id)init { return self; } +- (void)dealloc { + [_testDevices release]; + [_keywords release]; + [_extras release]; + [super dealloc]; +} + - (void)addTestDevice:(NSString *)deviceID { - if ([deviceID isEqualToString:GADU_SIMULATOR_ID]) { - [self.testDevices addObject:GAD_SIMULATOR_ID]; - } else { - [self.testDevices addObject:deviceID]; - } + [self.testDevices addObject:deviceID]; } - (void)addKeyword:(NSString *)keyword { @@ -64,10 +66,11 @@ - (GADRequest *)request { request.gender = self.gender; [request tagForChildDirectedTreatment:self.tagForChildDirectedTreatment]; [self.extras setValue:@"1" forKey:@"unity"]; - GADAdMobExtras *extras = [[[GADAdMobExtras alloc] init] autorelease]; + GADExtras *extras = [[[GADExtras alloc] init] autorelease]; extras.additionalParameters = self.extras; [request registerAdNetworkExtras:extras]; return request; } + @end