Skip to content

Commit

Permalink
Update AdMob SDK 8.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Astrovic committed Oct 23, 2021
1 parent 07df3fc commit 5981cf3
Show file tree
Hide file tree
Showing 36 changed files with 218 additions and 88 deletions.
8 changes: 4 additions & 4 deletions ios/Classes/TiAdmobModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,10 @@ - (void)setInMobi_updateGDPRConsent:(id)updateGDPRConsent
MAKE_SYSTEM_PROP(DEBUG_GEOGRAPHY_EEA, UMPDebugGeographyEEA);
MAKE_SYSTEM_PROP(DEBUG_GEOGRAPHY_NOT_EEA, UMPDebugGeographyNotEEA);

MAKE_SYSTEM_STR(SIMULATOR_ID, kGADSimulatorID);
MAKE_SYSTEM_PROP(GENDER_MALE, kGADGenderMale);
MAKE_SYSTEM_PROP(GENDER_FEMALE, kGADGenderFemale);
MAKE_SYSTEM_PROP(GENDER_UNKNOWN, kGADGenderUnknown);
MAKE_SYSTEM_STR(SIMULATOR_ID, GADSimulatorID);
//MAKE_SYSTEM_PROP(GENDER_MALE, kGADGenderMale); deleted from 4.5.0
//MAKE_SYSTEM_PROP(GENDER_FEMALE, kGADGenderFemale); deleted from 4.5.0
//MAKE_SYSTEM_PROP(GENDER_UNKNOWN, kGADGenderUnknown); deleted from 4.5.0
MAKE_SYSTEM_PROP(AD_TYPE_BANNER, TiAdmobAdTypeBanner);
MAKE_SYSTEM_PROP(AD_TYPE_INTERSTITIAL, TiAdmobAdTypeInterstitial);
MAKE_SYSTEM_PROP(AD_TYPE_REWARDED_VIDEO, TiAdmobAdTypeRewardedVideo);
Expand Down
6 changes: 3 additions & 3 deletions ios/documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,15 @@ A constant to be passed in an array to the `testDevices` property to get test ad

### Number `GENDER_MALE`

A constant to be passed to the `gender` property to specify a gender if used. **Deprecated by the AdMob SDK**.
A constant to be passed to the `gender` property to specify a gender if used. **Deprecated by the AdMob SDK, deleted from 4.5.0**.

### Number `GENDER_FEMALE`

A constant to be passed to the `gender` property to specify a gender if used. **Deprecated by the AdMob SDK**.
A constant to be passed to the `gender` property to specify a gender if used. **Deprecated by the AdMob SDK, deleted from 4.5.0**.

### Number `GENDER_UNKNOWN`

A constant to be passed to the `gender` property to specify a gender if used. **Deprecated by the AdMob SDK**.
A constant to be passed to the `gender` property to specify a gender if used. **Deprecated by the AdMob SDK,deleted from 4.5.0**.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion ios/documentation/view.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ for determining ad delivery.

### string gender

**Deprecated as part of the AdMob SDK**
**Deprecated as part of the AdMob SDK, deleted from 4.5.0**

The user's gender for the purpose of determining ad delivery. This should be one of the constants `GENDER_MALE`, `GENDER_FEMALE` or `GENDER_UNKNOWN`.

Expand Down
4 changes: 2 additions & 2 deletions ios/example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ function requestConsent() {
if (Admob.adProviders) {
if (Admob.adProviders.length > 0) {
if (Admob.adProviders[0].privacyPolicyURL) {
Ti.API.info('adProviders.length:', adProviders.length);
Ti.API.info('adProviders[0].privacyPolicyUR');
Ti.API.info('adProviders.length:', Admob.adProviders.length);
Ti.API.info('adProviders[0].privacyPolicyURL', Admob.adProviders[0].privacyPolicyURL);
//adProviders = Admob.adProviders;
};
};
Expand Down
2 changes: 1 addition & 1 deletion ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 4.4.0
version: 4.5.0
architectures: armv7 x86_64 arm64
mac: false
description: AdMob module for ad delivery via AdMob
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,29 @@ typedef NSString *GADAdLoaderAdType NS_STRING_ENUM;

/// Use with GADAdLoader to request native custom template ads. To receive ads, the ad loader's
/// delegate must conform to the GADCustomNativeAdLoaderDelegate protocol. See GADCustomNativeAd.h.
GAD_EXTERN GADAdLoaderAdType _Nonnull const kGADAdLoaderAdTypeCustomNative;
GAD_EXTERN GADAdLoaderAdType _Nonnull const GADAdLoaderAdTypeCustomNative;

/// Use with GADAdLoader to request Google Ad Manager banner ads. To receive ads, the ad loader's
/// delegate must conform to the GAMBannerAdLoaderDelegate protocol. See GAMBannerView.h.
GAD_EXTERN GADAdLoaderAdType _Nonnull const kGADAdLoaderAdTypeGAMBanner;
GAD_EXTERN GADAdLoaderAdType _Nonnull const GADAdLoaderAdTypeGAMBanner;

/// Use with GADAdLoader to request native ads. To receive ads, the ad loader's delegate must
/// conform to the GADNativeAdLoaderDelegate protocol. See GADNativeAd.h.
GAD_EXTERN GADAdLoaderAdType _Nonnull const kGADAdLoaderAdTypeNative;
GAD_EXTERN GADAdLoaderAdType _Nonnull const GADAdLoaderAdTypeNative;

#pragma mark Deprecated

/// Use with GADAdLoader to request native custom template ads. To receive ads, the ad loader's
/// delegate must conform to the GADCustomNativeAdLoaderDelegate protocol. See GADCustomNativeAd.h.
GAD_EXTERN GADAdLoaderAdType _Nonnull const kGADAdLoaderAdTypeCustomNative DEPRECATED_MSG_ATTRIBUTE(
"Use GADAdLoaderAdTypeCustomNative instead") NS_SWIFT_NAME(kGADAdLoaderAdTypeCustomNative);

/// Use with GADAdLoader to request Google Ad Manager banner ads. To receive ads, the ad loader's
/// delegate must conform to the GAMBannerAdLoaderDelegate protocol. See GAMBannerView.h.
GAD_EXTERN GADAdLoaderAdType _Nonnull const kGADAdLoaderAdTypeGAMBanner DEPRECATED_MSG_ATTRIBUTE(
"Use GADAdLoaderAdTypeGAMBanner instead") NS_SWIFT_NAME(kGADAdLoaderAdTypeGAMBanner);

/// Use with GADAdLoader to request native ads. To receive ads, the ad loader's delegate must
/// conform to the GADNativeAdLoaderDelegate protocol. See GADNativeAd.h.
GAD_EXTERN GADAdLoaderAdType _Nonnull const kGADAdLoaderAdTypeNative DEPRECATED_MSG_ATTRIBUTE(
"Use GADAdLoaderAdTypeNative instead") NS_SWIFT_NAME(kGADAdLoaderAdTypeNative);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/// constructed by GADAdSizeFromCGSize, GADAdSizeFullWidthPortraitWithHeight,
/// GADAdSizeFullWidthLandscapeWithHeight.
///
/// Do not create a GADAdSize manually. Use one of the kGADAdSize constants. Treat GADAdSize as an
/// Do not create a GADAdSize manually. Use one of the GADAdSize constants. Treat GADAdSize as an
/// opaque type. Do not access any fields directly. To obtain a concrete CGSize, use the function
/// CGSizeFromGADAdSize().
typedef struct GAD_BOXABLE GADAdSize GADAdSize;
Expand All @@ -31,31 +31,31 @@ struct GAD_BOXABLE GADAdSize {
#pragma mark Standard Sizes

/// iPhone and iPod Touch ad size. Typically 320x50.
GAD_EXTERN GADAdSize const kGADAdSizeBanner;
GAD_EXTERN GADAdSize const GADAdSizeBanner;

/// Taller version of kGADAdSizeBanner. Typically 320x100.
GAD_EXTERN GADAdSize const kGADAdSizeLargeBanner;
/// Taller version of GADAdSizeBanner. Typically 320x100.
GAD_EXTERN GADAdSize const GADAdSizeLargeBanner;

/// Medium Rectangle size for the iPad (especially in a UISplitView's left pane). Typically 300x250.
GAD_EXTERN GADAdSize const kGADAdSizeMediumRectangle;
GAD_EXTERN GADAdSize const GADAdSizeMediumRectangle;

/// Full Banner size for the iPad (especially in a UIPopoverController or in
/// UIModalPresentationFormSheet). Typically 468x60.
GAD_EXTERN GADAdSize const kGADAdSizeFullBanner;
GAD_EXTERN GADAdSize const GADAdSizeFullBanner;

/// Leaderboard size for the iPad. Typically 728x90.
GAD_EXTERN GADAdSize const kGADAdSizeLeaderboard;
GAD_EXTERN GADAdSize const GADAdSizeLeaderboard;

/// Skyscraper size for the iPad. Mediation only. AdMob/Google does not offer this size. Typically
/// 120x600.
GAD_EXTERN GADAdSize const kGADAdSizeSkyscraper;
GAD_EXTERN GADAdSize const GADAdSizeSkyscraper;

/// An ad size that spans the full width of its container, with a height dynamically determined by
/// the ad.
GAD_EXTERN GADAdSize const kGADAdSizeFluid;
GAD_EXTERN GADAdSize const GADAdSizeFluid;

/// Invalid ad size marker.
GAD_EXTERN GADAdSize const kGADAdSizeInvalid;
GAD_EXTERN GADAdSize const GADAdSizeInvalid;

#pragma mark Inline Adaptive Sizes

Expand Down Expand Up @@ -93,15 +93,15 @@ GAD_EXTERN GADAdSize GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight(CGFloat
#pragma mark Anchored Adaptive Sizes

/// Returns a GADAdSize with the given width and a Google-optimized height to create a banner ad.
/// The size returned has an aspect ratio similar to that of kGADAdSizeBanner, suitable for
/// The size returned has an aspect ratio similar to that of GADAdSizeBanner, suitable for
/// anchoring near the top or bottom of your app. The height is never larger than 15% of the
/// device's portrait height and is always between 50-90 points. This function always returns the
/// same height for any width / device combination.
GAD_EXTERN GADAdSize GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width);

/// Returns a GADAdSize with the given width and a Google-optimized height to create a banner ad.
/// The size returned is suitable for use in a banner ad anchored near the top or bottom of your
/// app, similar to use of kGADAdSizeBanner. The height is never larger than 15% of the devices's
/// app, similar to use of GADAdSizeBanner. The height is never larger than 15% of the devices's
/// landscape height and is always between 50-90 points. This function always returns the same
/// height for any width / device combination.
GAD_EXTERN GADAdSize GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width);
Expand Down Expand Up @@ -148,7 +148,7 @@ GAD_EXTERN NSString *_Nonnull NSStringFromGADAdSize(GADAdSize size);
/// Returns an NSValue representing the GADAdSize.
GAD_EXTERN NSValue *_Nonnull NSValueFromGADAdSize(GADAdSize size);

/// Returns a GADAdSize from an NSValue. Returns kGADAdSizeInvalid if the value is not a GADAdSize.
/// Returns a GADAdSize from an NSValue. Returns GADAdSizeInvalid if the value is not a GADAdSize.
GAD_EXTERN GADAdSize GADAdSizeFromNSValue(NSValue *_Nonnull value);

#pragma mark Deprecated
Expand All @@ -162,3 +162,35 @@ GAD_EXTERN GADAdSize const kGADAdSizeSmartBannerPortrait
/// typically 32 points on an iPhone/iPod UI, and 90 points tall on an iPad UI.
GAD_EXTERN GADAdSize const kGADAdSizeSmartBannerLandscape
GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth");

/// iPhone and iPod Touch ad size. Typically 320x50.
GAD_EXTERN GADAdSize const kGADAdSizeBanner GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADAdSizeBanner");

/// Taller version of GADAdSizeBanner. Typically 320x100.
GAD_EXTERN GADAdSize const kGADAdSizeLargeBanner
GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADAdSizeLargeBanner");

/// Medium Rectangle size for the iPad (especially in a UISplitView's left pane). Typically 300x250.
GAD_EXTERN GADAdSize const kGADAdSizeMediumRectangle
GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADAdSizeMediumRectangle");

/// Full Banner size for the iPad (especially in a UIPopoverController or in
/// UIModalPresentationFormSheet). Typically 468x60.
GAD_EXTERN GADAdSize const kGADAdSizeFullBanner
GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADAdSizeFullBanner");

/// Leaderboard size for the iPad. Typically 728x90.
GAD_EXTERN GADAdSize const kGADAdSizeLeaderboard
GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADAdSizeLeaderboard");

/// Skyscraper size for the iPad. Mediation only. AdMob/Google does not offer this size. Typically
/// 120x600.
GAD_EXTERN GADAdSize const kGADAdSizeSkyscraper
GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADAdSizeSkyscraper");

/// An ad size that spans the full width of its container, with a height dynamically determined by
/// the ad.
GAD_EXTERN GADAdSize const kGADAdSizeFluid GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADAdSizeFluid");

/// Invalid ad size marker.
GAD_EXTERN GADAdSize const kGADAdSizeInvalid GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADAdSizeInvalid");
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@property(nonatomic, weak, nullable) IBOutlet UIViewController *rootViewController;

/// Required to set this banner view to a proper size. Never create your own GADAdSize directly.
/// Use one of the predefined standard ad sizes (such as kGADAdSizeBanner), or create one using the
/// Use one of the predefined standard ad sizes (such as GADAdSizeBanner), or create one using the
/// GADAdSizeFromCGSize method. If not using mediation, then changing the adSize after an ad has
/// been shown will cause a new request (for an ad of the new size) to be sent. If using mediation,
/// then a new request may not be sent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GAD_EXTERN NSString *_Nonnull const GADCustomNativeAdMediaViewKey;
@protocol GADCustomNativeAdDelegate;

/// Custom native ad. To request this ad type, you need to pass
/// kGADAdLoaderAdTypeCustomNative (see GADAdLoaderAdTypes.h) to the |adTypes| parameter
/// GADAdLoaderAdTypeCustomNative (see GADAdLoaderAdTypes.h) to the |adTypes| parameter
/// in GADAdLoader's initializer method. If you request this ad type, your delegate must conform to
/// the GADCustomNativeAdLoaderDelegate protocol.
@interface GADCustomNativeAd : NSObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#import <GoogleMobileAds/GADVideoController.h>
#import <UIKit/UIKit.h>

/// Native ad. To request this ad type, pass kGADAdLoaderAdTypeNative
/// Native ad. To request this ad type, pass GADAdLoaderAdTypeNative
/// (see GADAdLoaderAdTypes.h) to the |adTypes| parameter in GADAdLoader's initializer method. If
/// you request this ad type, your delegate must conform to the GADNativeAdLoaderDelegate
/// protocol.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
#import <UIKit/UIKit.h>

/// Add this constant to the testDevices property's array to receive test ads on the simulator.
GAD_EXTERN NSString *_Nonnull const kGADSimulatorID;
GAD_EXTERN NSString *_Nonnull const kGADSimulatorID GAD_DEPRECATED_MSG_ATTRIBUTE(
"Use GADRequestConfiguration/GADSimulatorID instead.");

/// Deprecated gender constants.
typedef NS_ENUM(NSInteger, GADGender) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ GAD_EXTERN GADMaxAdContentRating _Nonnull const GADMaxAdContentRatingTeen;
/// Rating for content suitable only for mature audiences.
GAD_EXTERN GADMaxAdContentRating _Nonnull const GADMaxAdContentRatingMatureAudience;

/// Add this constant to the testDevices property's array to receive test ads on the simulator.
GAD_EXTERN NSString *_Nonnull const GADSimulatorID;

/// Request configuration. The settings in this class will apply to all ad requests.
@interface GADRequestConfiguration : NSObject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/// GADDynamicHeightSearchRequest object.
@interface GADSearchBannerView : GADBannerView

/// If the banner view is initialized with kGADAdSizeFluid and the corresponding request is created
/// If the banner view is initialized with GADAdSizeFluid and the corresponding request is created
/// with dynamic height parameters, this delegate will be called when the ad size changes.
@property(nonatomic, weak, nullable) IBOutlet id<GADAdSizeDelegate> adSizeDelegate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/// The view that displays Ad Manager banner ads.
///
/// To request this ad type using GADAdLoader, you need to pass kGADAdLoaderAdTypeGAMBanner (see
/// To request this ad type using GADAdLoader, you need to pass GADAdLoaderAdTypeGAMBanner (see
/// GADAdLoaderAdTypes.h) to the |adTypes| parameter in GADAdLoader's initializer method. If you
/// request this ad type, your delegate must conform to the GAMBannerAdLoaderDelegate protocol.
@interface GAMBannerView : GADBannerView
Expand All @@ -47,15 +47,15 @@

/// 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
/// standard ad sizes (such as GADAdSizeBanner), or create one using the GADAdSizeFromCGSize
/// method.
///
/// Example:
///
/// \code
/// NSArray *validSizes = @[
/// NSValueFromGADAdSize(kGADAdSizeBanner),
/// NSValueFromGADAdSize(kGADAdSizeLargeBanner)
/// NSValueFromGADAdSize(GADAdSizeBanner),
/// NSValueFromGADAdSize(GADAdSizeLargeBanner)
/// ];
///
/// bannerView.validAdSizes = validSizes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import <UIKit/UIKit.h>

/// Subclasses should prefix their name with "GADMAdapter" example: GADMAdapterGoogleAdMobAds
#define kGADMAdapterClassNamePrefix @"GADMAdapter"
#define GADMAdapterClassNamePrefix @"GADMAdapter"

/// Ad network adapter protocol.
@protocol GADMAdNetworkAdapter <NSObject>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,24 @@

/// These are the types of animation we employ for transitions between two mediated ads.
typedef NS_ENUM(NSInteger, GADMBannerAnimationType) {
kGADMBannerAnimationTypeNone = 0, ///< No animation.
kGADMBannerAnimationTypeFlipFromLeft = 1, ///< Flip from left.
kGADMBannerAnimationTypeFlipFromRight = 2, ///< Flip from right.
kGADMBannerAnimationTypeCurlUp = 3, ///< Curl up.
kGADMBannerAnimationTypeCurlDown = 4, ///< Curl down.
kGADMBannerAnimationTypeSlideFromLeft = 5, ///< Slide from left.
kGADMBannerAnimationTypeSlideFromRight = 6, ///< Slide from right.
kGADMBannerAnimationTypeFadeIn = 7, ///< Fade in.
kGADMBannerAnimationTypeRandom = 8, ///< Random animation.
GADMBannerAnimationTypeNone = 0, ///< No animation.
GADMBannerAnimationTypeFlipFromLeft = 1, ///< Flip from left.
GADMBannerAnimationTypeFlipFromRight = 2, ///< Flip from right.
GADMBannerAnimationTypeCurlUp = 3, ///< Curl up.
GADMBannerAnimationTypeCurlDown = 4, ///< Curl down.
GADMBannerAnimationTypeSlideFromLeft = 5, ///< Slide from left.
GADMBannerAnimationTypeSlideFromRight = 6, ///< Slide from right.
GADMBannerAnimationTypeFadeIn = 7, ///< Fade in.
GADMBannerAnimationTypeRandom = 8, ///< Random animation.

/// Deprecated enums.
kGADMBannerAnimationTypeNone = 0, ///< Deprecated. No animation.
kGADMBannerAnimationTypeFlipFromLeft = 1, ///< Deprecated. Flip from left.
kGADMBannerAnimationTypeFlipFromRight = 2, ///< Deprecated. Flip from right.
kGADMBannerAnimationTypeCurlUp = 3, ///< Deprecated. Curl up.
kGADMBannerAnimationTypeCurlDown = 4, ///< Deprecated. Curl down.
kGADMBannerAnimationTypeSlideFromLeft = 5, ///< Deprecated. Slide from left.
kGADMBannerAnimationTypeSlideFromRight = 6, ///< Deprecated. Slide from right.
kGADMBannerAnimationTypeFadeIn = 7, ///< Deprecated. Fade in.
kGADMBannerAnimationTypeRandom = 8, ///< Deprecated. Random animation.
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
/// Returns the closest valid ad size from possibleAdSizes as compared to |original|. The selected
/// size must be smaller than or equal in size to the original. The selected size must also be
/// within a configurable fraction of the width and height of the original. If no valid size exists,
/// returns kGADAdSizeInvalid.
/// returns GADAdSizeInvalid.
GAD_EXTERN GADAdSize GADClosestValidSizeForAdSizes(GADAdSize original,
NSArray<NSValue *> *_Nonnull possibleAdSizes);
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#import <GoogleMobileAds/GoogleMobileAdsDefines.h>

/// Google AdMob Ads error domain.
GAD_EXTERN NSString *_Nonnull const kGADErrorDomain;
GAD_EXTERN NSString *_Nonnull const kGADErrorDomain DEPRECATED_MSG_ATTRIBUTE(
"Use GADRequestError/GADErrorDomain instead");

/// NSError codes for GAD error domain.
typedef NS_ENUM(NSInteger, GADMediationErrorCode) {
Expand Down
Loading

0 comments on commit 5981cf3

Please sign in to comment.