Skip to content

Commit

Permalink
Adding support for Google Mobile Ads iOS 7.0.0 SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Ram Parameswaran committed Feb 24, 2015
1 parent ab4078f commit a619273
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 30 deletions.
11 changes: 4 additions & 7 deletions unity/source/Assets/Plugins/iOS/GADUBanner.m
@@ -1,15 +1,12 @@
// Copyright 2014 Google Inc. All Rights Reserved.

#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@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 ()<GADBannerViewDelegate>
Expand Down
11 changes: 4 additions & 7 deletions unity/source/Assets/Plugins/iOS/GADUInterstitial.m
@@ -1,15 +1,12 @@
// Copyright 2014 Google Inc. All Rights Reserved.

#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@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 ()<GADInterstitialDelegate>
Expand Down
2 changes: 1 addition & 1 deletion unity/source/Assets/Plugins/iOS/GADUObjectCache.m
@@ -1,6 +1,6 @@
// Copyright 2014 Google Inc. All Rights Reserved.

#import <Foundation/Foundation.h>
@import Foundation;

#import "GADUObjectCache.h"

Expand Down
8 changes: 2 additions & 6 deletions unity/source/Assets/Plugins/iOS/GADURequest.h
@@ -1,11 +1,7 @@
// Copyright 2014 Google Inc. All Rights Reserved.

#import <Foundation/Foundation.h>

#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) {
Expand Down
21 changes: 12 additions & 9 deletions unity/source/Assets/Plugins/iOS/GADURequest.m
@@ -1,9 +1,8 @@
// Copyright 2014 Google Inc. All Rights Reserved.

#import <Foundation/Foundation.h>
@import Foundation;
@import GoogleMobileAds;

#import "GADAdMobExtras.h"
#import "GADRequest.h"
#import "GADURequest.h"

@implementation GADURequest
Expand All @@ -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 {
Expand Down Expand Up @@ -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

3 comments on commit a619273

@paradizIscool
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update readme to explain how to compile ? Modules was not supported in my projet and then I have "Module 'GoogleMobileAds' not found" error.

@rampara
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ReadMe will be updated when these changes are pushed out in a release. Can you try removing and re-adding the iOS Google Mobile Ads SDK from your project to see if that helps.

  • Ram

@paradizIscool
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just solved my issues (local build and jenkins build process), I had to change GoogleMobileAds.framework. The official framework (like many others) use symbolic link to Version folder and this was my issue. It works perfectly when I put framework file by hand (xcode seems to do the job), but fail when I change pbx with mod_pbxproj

Please sign in to comment.