Skip to content

Commit

Permalink
MS-682 Update to AdMob SDK 6.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Ha committed May 14, 2014
1 parent 2acaef2 commit 1fac416
Show file tree
Hide file tree
Showing 27 changed files with 535 additions and 488 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,44 @@
@protocol GADAdSizeDelegate;
@protocol GADAppEventDelegate;

/// The view that displays DoubleClick For Publishers banner ads.
@interface DFPBannerView : GADBannerView

// Optional delegate object that will be notified if a creative sends
// app events. Remember to nil out this property before releasing the object
// that implements the GADAppEventDelegate protocol to avoid crashing the app.
@property(nonatomic, assign) NSObject<GADAppEventDelegate> *appEventDelegate;

// Optional delegate object that will be notified if a creative causes the
// banner to change size. Remember to nil out this property before releasing the
// object that implements the GADAdSizeDelegate protocol to avoid crashing the
// app.
@property(nonatomic, assign) NSObject<GADAdSizeDelegate> *adSizeDelegate;

// Optional array of GADAdSize to specify all valid sizes that are appropriate
// for this slot. Never create your own GADAdSize directly. Use one of the
// predefined standard ad sizes (such as kGADAdSizeBanner), or create one using
// the GADAdSizeFromCGSize method.
//
// Example code:
// GADAdSize size1 = GADAdSizeFromCGSize(CGSizeMake(320, 50));
// GADAdSize size2 = GADAdSizeFromCGSize(CGSizeMake(300, 50));
// NSMutableArray *validSizes = [NSMutableArray array];
// [validSizes addObject:[NSValue valueWithBytes:&size1
// objCType:@encode(GADAdSize)]];
// [validSizes addObject:[NSValue valueWithBytes:&size2
// objCType:@encode(GADAdSize)]];
//
// myView.validAdSizes = validSizes;
@property(nonatomic, retain) NSArray *validAdSizes;

// Flag allowing publisher to specify when the ad is visible to the user.
/// Optional delegate that is notified when creatives send app events. To avoid crashing the app,
/// remember to nil this property before releasing the object that implements the
/// GADAppEventDelegate protocol.
@property(nonatomic, weak) NSObject<GADAppEventDelegate> *appEventDelegate;

/// Optional delegate that is notified when creatives cause the banner to change size. To avoid
/// crashing the app, remember to nil this property before releasing the object that implements the
/// GADAdSizeDelegate protocol.
@property(nonatomic, weak) NSObject<GADAdSizeDelegate> *adSizeDelegate;

/// Optional array of NSValue encoded GADAdSize structs, specifying all valid sizes that are
/// appropriate for this slot. Never create your own GADAdSize directly. Use one of the predefined
/// standard ad sizes (such as kGADAdSizeBanner), or create one using the GADAdSizeFromCGSize
/// method.
///
/// Example:
/// \code
/// GADAdSize size1 = GADAdSizeFromCGSize(CGSizeMake(320, 50));
/// GADAdSize size2 = GADAdSizeFromCGSize(CGSizeMake(300, 50));
/// NSMutableArray *validSizes = [NSMutableArray array];
/// [validSizes addObject:[NSValue valueWithBytes:&size1 objCType:@encode(GADAdSize)]];
/// [validSizes addObject:[NSValue valueWithBytes:&size2 objCType:@encode(GADAdSize)]];
///
/// myView.validAdSizes = validSizes;
/// \endcode
@property(nonatomic, strong) NSArray *validAdSizes;

/// Indicates that the publisher will record impressions manually when the ad becomes visible to the
/// user.
@property(nonatomic, assign) BOOL enableManualImpressions;

// Call this when the ad is visible and if you have set enableManualImpressions
// to YES.
/// If you've set enableManualImpressions to YES, call this method when the ad is visible.
- (void)recordImpression;

// Use this function to resize the banner view without launching a new ad
// request.
/// Use this function to resize the banner view without launching a new ad request.
- (void)resize:(GADAdSize)size;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

@interface DFPExtras : GADAdMobExtras

/// Content URL for targeting information.
@property(nonatomic, copy) NSString *contentURL;
/// Publisher provided user ID.
@property(nonatomic, copy) NSString *publisherProvidedID;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

@interface DFPInterstitial : GADInterstitial

@property(nonatomic, assign) NSObject<GADAppEventDelegate> *appEventDelegate;
@property(nonatomic, weak) NSObject<GADAppEventDelegate> *appEventDelegate;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

@interface DFPSwipeableBannerView : DFPBannerView

// Set a delegate to be notified when the user activates and deactivates an ad.
// Remember to nil out the delegate before releasing this banner.
@property(nonatomic, assign) NSObject<GADSwipeableBannerViewDelegate> *swipeDelegate;
/// Set a delegate to be notified when the user activates and deactivates an ad. Remember to nil out
/// the delegate before releasing this banner.
@property(nonatomic, weak) NSObject<GADSwipeableBannerViewDelegate> *swipeDelegate;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

@protocol GADAppEventDelegate<NSObject>

// Implement your app event within these methods. The delegate will be notified
// when the SDK receives an app event message from the ad.
/// Implement your app event within these methods. The delegate will be notified when the SDK
/// receives an app event message from the ad.
@optional

- (void)adView:(GADBannerView *)banner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
//
// Copyright (c) 2012 Google Inc. All rights reserved.
//
// The delegate will be notified when a user activates and deactivates an ad.
// If the DFPSwipeableBannerView is contained within a UIScrollView, make sure
// to set scrollEnabled = NO when -adViewDidActivateAd: is notified and to set
// back to YES when -adViewDidDeactivateAd: is notified.
//

#import <Foundation/Foundation.h>

@class GADBannerView;

/// The delegate will be notified when a user activates and deactivates an ad. If the
/// DFPSwipeableBannerView is contained within a UIScrollView, make sure to set scrollEnabled to NO
/// when -adViewDidActivateAd: is called and to set back to YES when -adViewDidDeactivateAd: is
/// called.
@protocol GADSwipeableBannerViewDelegate<NSObject>

@optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,28 @@
#import "GADCustomEventBannerDelegate.h"
#import "GADCustomEventRequest.h"

// The protocol for a Custom Event of the banner type.
// Your Custom Event handler object for banners must implement this protocol.
// The requestBannerAd method will be called when Mediation schedules your
// Custom Event to be executed.
/// The protocol for a Custom Event of the banner type. Your Custom Event handler object for banners
/// must implement this protocol. The requestBannerAd method will be called when mediation schedules
/// your Custom Event to be executed.
@protocol GADCustomEventBanner<NSObject>

// This method is called by Mediation when your Custom Event is scheduled to
// be executed. Results of the execution should be reported back via the
// delegate. |adSize| is the size of the ad as configured in the Mediation UI
// for the Mediation Placement. |serverParameter| and |serverLabel| are the
// parameter and label configured in the Mediation UI for the Custom Event.
// |request| contains information about the ad request, some of those are from
// GADRequest.
/// This method is called by mediation when your Custom Event is scheduled to be executed. Results
/// of the execution should be reported back via the delegate. |adSize| is the size of the ad as
/// configured in the mediation UI for the mediation placement. |serverParameter| and |serverLabel|
/// are the parameter and label configured in the mediation UI for the Custom Event. |request|
/// contains information about the ad request, some of those are from GADRequest.
- (void)requestBannerAd:(GADAdSize)adSize
parameter:(NSString *)serverParameter
label:(NSString *)serverLabel
request:(GADCustomEventRequest *)request;

// You should call back to the |delegate| with the results of the execution
// to ensure Mediation behaves correctly. The delegate is assigned, not
// retained, to prevent memory leak caused by circular retention.
//
// You can create accessor methods either by doing
//
// @synthesize delegate;
//
// in your class implementation, or define the methods -delegate and
// -setDelegate: yourself.
//
// In your object's -dealloc method, remember to nil out the delegate.
@property(nonatomic, assign) id<GADCustomEventBannerDelegate> delegate;
/// You should call back to the |delegate| with the results of the execution to ensure mediation
/// behaves correctly. The delegate is weakly referenced to prevent memory leaks caused by circular
/// retention.
///
/// Define the -delegate and -setDelegate: methods in your class.
///
/// In your class's -dealloc method, remember to nil out the delegate.
@property(nonatomic, weak) id<GADCustomEventBannerDelegate> delegate;

@end
Original file line number Diff line number Diff line change
@@ -1,58 +1,53 @@
//
// GADCustomEventBannerDelegate.h
// Google AdMob Ads SDK
//
// Copyright 2012 Google Inc. All rights reserved.
//
// Call back to this delegate in your custom event. You must call
// customEventBanner:didReceiveAd: when there is an ad to show, or
// customEventBanner:didFailAd: when there is no ad to show. Otherwise, if
// enough time passed (several seconds) after the SDK called the
// requestBannerAd: method of your custom event, the mediation SDK will consider
// the request timed out, and move on to the next ad network.
//
///
/// GADCustomEventBannerDelegate.h
/// Google AdMob Ads SDK
///
/// Copyright 2012 Google Inc. All rights reserved.
///

#import <Foundation/Foundation.h>

@protocol GADCustomEventBanner;

/// Call back to this delegate in your custom event. You must call customEventBanner:didReceiveAd:
/// when there is an ad to show, or customEventBanner:didFailAd: when there is no ad to show.
/// Otherwise, if enough time passed (several seconds) after the SDK called the requestBannerAd:
/// method of your custom event, the mediation SDK will consider the request timed out, and move on
/// to the next ad network.
@protocol GADCustomEventBannerDelegate<NSObject>

// Your Custom Event object must call this when it receives or creates an ad
// view.
/// Your Custom Event object must call this when it receives or creates an ad view.
- (void)customEventBanner:(id<GADCustomEventBanner>)customEvent didReceiveAd:(UIView *)view;

// Your Custom Event object must call this when it fails to receive or
// create the ad view. Pass along any error object sent from the ad network's
// SDK, or an NSError describing the error. Pass nil if not available.
/// Your Custom Event object must call this when it fails to receive or create the ad view. Pass
/// along any error object sent from the ad network's SDK, or an NSError describing the error. Pass
/// nil if not available.
- (void)customEventBanner:(id<GADCustomEventBanner>)customEvent didFailAd:(NSError *)error;

// Your Custom Event object should call this when the user touches or "clicks"
// the ad to initiate an action. When the SDK receives this callback, it reports
// the click back to the Mediation server. This callback is optional.
/// Your Custom Event object should call this when the user touches or "clicks" the ad to initiate
/// an action. When the SDK receives this callback, it reports the click back to the Mediation
/// server. This callback is optional.
- (void)customEventBanner:(id<GADCustomEventBanner>)customEvent clickDidOccurInAd:(UIView *)view;

// The rootViewController that you set in GADBannerView.
// Use this UIViewController to show a modal view when a user taps on the ad.
/// The rootViewController that you set in GADBannerView. Use this UIViewController to show a modal
/// view when a user taps on the ad.
@property(nonatomic, readonly) UIViewController *viewControllerForPresentingModalView;

// When you call the following methods, the call will be propagated back to the
// GADBannerViewDelegate that you implemented and passed to GADBannerView.
/// When you call the following methods, the call will be propagated back to the
/// GADBannerViewDelegate that you implemented and passed to GADBannerView.

// Your Custom Event should call this when the user taps an ad and a modal view
// appears.
/// Your Custom Event should call this when the user taps an ad and a modal view appears.
- (void)customEventBannerWillPresentModal:(id<GADCustomEventBanner>)customEvent;

// Your Custom Event should call this when the user dismisses the modal view
// and the modal view is about to go away.
/// Your Custom Event should call this when the user dismisses the modal view and the modal view is
/// about to go away.
- (void)customEventBannerWillDismissModal:(id<GADCustomEventBanner>)customEvent;

// Your Custom Event should call this when the user dismisses the modal view
// and the modal view has gone away.
/// Your Custom Event should call this when the user dismisses the modal view and the modal view has
/// gone away.
- (void)customEventBannerDidDismissModal:(id<GADCustomEventBanner>)customEvent;

// Your Custom Event should call this method when a user action will result in
// App switching.
/// Your Custom Event should call this method when a user action will result in App switching.
- (void)customEventBannerWillLeaveApplication:(id<GADCustomEventBanner>)customEvent;

@end
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
//
// GADCustomEventExtras.h
// Google Ads iOS SDK
//
// Copyright (c) 2012 Google Inc. All rights reserved.
//
// Create an instance of this class to set additional parameters for each
// custom event object. The additional parameters for a custom event are
// keyed by the custom event label. These extras are passed to your
// implementation of GADCustomEventBanner or GADCustomEventInterstitial.
//
///
/// GADCustomEventExtras.h
/// Google Ads iOS SDK
///
/// Copyright (c) 2012 Google Inc. All rights reserved.
///

#import <Foundation/Foundation.h>

#import "GADAdNetworkExtras.h"

/// Create an instance of this class to set additional parameters for each custom event object. The
/// additional parameters for a custom event are keyed by the custom event label. These extras are
/// passed to your implementation of GADCustomEventBanner or GADCustomEventInterstitial.
@interface GADCustomEventExtras : NSObject<GADAdNetworkExtras>

// Set additional parameters for the custom event with label |label|. To remove
// additional parameters associated with |label|, pass in nil for |extras|.
/// Set additional parameters for the custom event with label |label|. To remove additional
/// parameters associated with |label|, pass in nil for |extras|.
- (void)setExtras:(NSDictionary *)extras forLabel:(NSString *)label;

// Retrieve the extras for |label|.
/// Retrieve the extras for |label|.
- (NSDictionary *)extrasForLabel:(NSString *)label;

// Removes all the extras set on this instance.
/// Removes all the extras set on this instance.
- (void)removeAllExtras;

// Returns all the extras set on this instance.
/// Returns all the extras set on this instance.
- (NSDictionary *)allExtras;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,35 @@
#import "GADCustomEventInterstitialDelegate.h"
#import "GADCustomEventRequest.h"

// The protocol for a Custom Event of the interstitial type.
// Your Custom Event handler object for interstitial must implement this
// protocol. The requestInterstitialAd method will be called when Mediation
// schedules your Custom Event to be executed.
/// The protocol for a Custom Event of the interstitial type. Your Custom Event handler object for
/// interstitial must implement this protocol. The requestInterstitialAd method will be called when
/// mediation schedules your Custom Event to be executed.
@protocol GADCustomEventInterstitial<NSObject>

// This method is called by Mediation when your Custom Event is scheduled to
// be executed. Your implementation should begin retrieval of the interstitial
// ad, usually from a backend server, or from an ad network SDK. Results of the
// execution should be reported back via the delegate. Note that you should wait
// until -presentFromRootViewController is called before displaying the
// interstitial ad. Do not automatically display the ad when you receive the ad.
// Instead, retain the ad and display it when presentFromRootViewController is
// called.
// |serverParameter| and |serverLabel| are the parameter and
// label configured in the AdMob Mediation UI for the Custom Event. |request|
// contains information about the ad request, some of those are from GADRequest.
/// You should call back to the |delegate| with the results of the execution to ensure mediation
/// behaves correctly. The delegate is assigned, not retained, to prevent memory leak caused by
/// circular retention.
///
/// Define the -delegate and -setDelegate: methods in your class.
///
/// In your class's -dealloc method, remember to nil out the delegate.
@property(nonatomic, weak) id<GADCustomEventInterstitialDelegate> delegate;

/// This method is called by mediation when your Custom Event is scheduled to be executed. Your
/// implementation should begin retrieval of the interstitial ad, usually from a backend server, or
/// from an ad network SDK. Results of the execution should be reported back via the delegate. Note
/// that you should wait until -presentFromRootViewController is called before displaying the
/// interstitial ad. Do not automatically display the ad when you receive the ad. Instead, retain
/// the ad and display it when presentFromRootViewController is called. |serverParameter| and
/// |serverLabel| are the parameter and label configured in the AdMob mediation UI for the Custom
/// Event. |request| contains information about the ad request, some of those are from GADRequest.
- (void)requestInterstitialAdWithParameter:(NSString *)serverParameter
label:(NSString *)serverLabel
request:(GADCustomEventRequest *)request;

// Present the interstitial ad as a modal view using the provided view
// controller. This is called only after your Custom Event calls back
// to the delegate with the message -customEvent:didReceiveAd: .
/// Present the interstitial ad as a modal view using the provided view controller. This is called
/// only after your Custom Event calls back to the delegate with the message
/// -customEvent:didReceiveAd: .
- (void)presentFromRootViewController:(UIViewController *)rootViewController;

// You should call back to the |delegate| with the results of the execution
// to ensure Mediation behaves correctly. The delegate is assigned, not
// retained, to prevent memory leak caused by circular retention.
//
// You can create accessor methods either by doing
//
// @synthesize delegate;
//
// in your class implementation, or define the methods -delegate and
// -setDelegate: yourself.
//
// In your object's -dealloc method, remember to nil out the delegate.
@property(nonatomic, assign) id<GADCustomEventInterstitialDelegate> delegate;

@end
Loading

0 comments on commit 1fac416

Please sign in to comment.