Skip to content

Commit

Permalink
Update GoogleMobileAds 9.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TA MINH QUANG authored and TA MINH QUANG committed May 27, 2022
1 parent 21c21cc commit 752b3dd
Show file tree
Hide file tree
Showing 24 changed files with 128 additions and 118 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ 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.
extern GADAdLoaderAdType _Nonnull const GADAdLoaderAdTypeCustomNative;
FOUNDATION_EXPORT 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.
extern GADAdLoaderAdType _Nonnull const GADAdLoaderAdTypeGAMBanner;
FOUNDATION_EXPORT 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.
extern GADAdLoaderAdType _Nonnull const GADAdLoaderAdTypeNative;
FOUNDATION_EXPORT GADAdLoaderAdType _Nonnull const GADAdLoaderAdTypeNative;
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,31 @@ struct GAD_BOXABLE GADAdSize {
#pragma mark Standard Sizes

/// iPhone and iPod Touch ad size. Typically 320x50.
extern GADAdSize const GADAdSizeBanner;
FOUNDATION_EXPORT GADAdSize const GADAdSizeBanner;

/// Taller version of GADAdSizeBanner. Typically 320x100.
extern GADAdSize const GADAdSizeLargeBanner;
FOUNDATION_EXPORT GADAdSize const GADAdSizeLargeBanner;

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

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

/// Leaderboard size for the iPad. Typically 728x90.
extern GADAdSize const GADAdSizeLeaderboard;
FOUNDATION_EXPORT GADAdSize const GADAdSizeLeaderboard;

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

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

/// Invalid ad size marker.
extern GADAdSize const GADAdSizeInvalid;
FOUNDATION_EXPORT GADAdSize const GADAdSizeInvalid;

#pragma mark Inline Adaptive Sizes

Expand All @@ -64,20 +64,20 @@ extern GADAdSize const GADAdSizeInvalid;
/// exact size of the ad returned is passed through the banner's ad size delegate and is indicated
/// by the banner's intrinsicContentSize. This ad size is most suitable for ads intended for scroll
/// views.
extern GADAdSize GADPortraitInlineAdaptiveBannerAdSizeWithWidth(CGFloat width);
FOUNDATION_EXPORT GADAdSize GADPortraitInlineAdaptiveBannerAdSizeWithWidth(CGFloat width);

/// Returns a GADAdSize with the given width and the device's landscape height. This ad size
/// allows Google servers to choose an optimal ad size less than or equal to the returned size. The
/// exact size of the ad returned is passed through the banner's ad size delegate and is indicated
/// by the banner's intrinsicContentSize. This ad size is most suitable for ads intended for scroll
/// views.
extern GADAdSize GADLandscapeInlineAdaptiveBannerAdSizeWithWidth(CGFloat width);
FOUNDATION_EXPORT GADAdSize GADLandscapeInlineAdaptiveBannerAdSizeWithWidth(CGFloat width);

/// Returns a GADAdSize with the given width and the device's height. This is a convenience
/// function to return GADPortraitInlineAdaptiveBannerAdSizeWithWidth or
/// GADLandscapeInlineAdaptiveBannerAdSizeWithWidth based on the current interface orientation.
/// This function must be called on the main queue.
extern GADAdSize GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(CGFloat width);
FOUNDATION_EXPORT GADAdSize GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(CGFloat width);

/// Returns a GADAdSize with the given width and max height. This ad size allows Google servers to
/// choose an optimal ad size less than or equal to the returned size. The exact size of the ad
Expand All @@ -87,8 +87,8 @@ extern GADAdSize GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(CGFloa
/// @param width The ad width.
/// @param maxHeight The maximum height a loaded ad will have. Must be at least 32 px, but a max
/// height of 50 px or higher is recommended.
extern GADAdSize GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight(CGFloat width,
CGFloat maxHeight);
FOUNDATION_EXPORT GADAdSize GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight(CGFloat width,
CGFloat maxHeight);

#pragma mark Anchored Adaptive Sizes

Expand All @@ -97,68 +97,69 @@ extern GADAdSize GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight(CGFloat widt
/// 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.
extern GADAdSize GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width);
FOUNDATION_EXPORT 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 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.
extern GADAdSize GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width);
FOUNDATION_EXPORT GADAdSize GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width);

/// Returns a GADAdSize with the given width and a Google-optimized height. This is a convenience
/// function to return GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth or
/// GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth based on the current interface orientation.
/// This function must be called on the main queue.
extern GADAdSize GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width);
FOUNDATION_EXPORT GADAdSize
GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width);

#pragma mark Custom Sizes

/// Returns a custom GADAdSize for the provided CGSize. Use this only if you require a non-standard
/// size. Otherwise, use one of the standard size constants above.
extern GADAdSize GADAdSizeFromCGSize(CGSize size);
FOUNDATION_EXPORT GADAdSize GADAdSizeFromCGSize(CGSize size);

/// Returns a custom GADAdSize that spans the full width of the application in portrait orientation
/// with the height provided.
extern GADAdSize GADAdSizeFullWidthPortraitWithHeight(CGFloat height);
FOUNDATION_EXPORT GADAdSize GADAdSizeFullWidthPortraitWithHeight(CGFloat height);

/// Returns a custom GADAdSize that spans the full width of the application in landscape orientation
/// with the height provided.
extern GADAdSize GADAdSizeFullWidthLandscapeWithHeight(CGFloat height);
FOUNDATION_EXPORT GADAdSize GADAdSizeFullWidthLandscapeWithHeight(CGFloat height);

#pragma mark Convenience Functions

/// Returns YES if the two GADAdSizes are equal, otherwise returns NO.
extern BOOL GADAdSizeEqualToSize(GADAdSize size1, GADAdSize size2);
FOUNDATION_EXPORT BOOL GADAdSizeEqualToSize(GADAdSize size1, GADAdSize size2);

/// Returns a CGSize for the provided a GADAdSize constant. If the GADAdSize is unknown, returns
/// CGSizeZero.
extern CGSize CGSizeFromGADAdSize(GADAdSize size);
FOUNDATION_EXPORT CGSize CGSizeFromGADAdSize(GADAdSize size);

/// Returns YES if |size| is one of the predefined constants or is a custom GADAdSize generated by
/// GADAdSizeFromCGSize.
extern BOOL IsGADAdSizeValid(GADAdSize size);
FOUNDATION_EXPORT BOOL IsGADAdSizeValid(GADAdSize size);

/// Returns YES if |size| is a fluid ad size.
extern BOOL GADAdSizeIsFluid(GADAdSize size);
FOUNDATION_EXPORT BOOL GADAdSizeIsFluid(GADAdSize size);

/// Returns a NSString describing the provided GADAdSize.
extern NSString *_Nonnull NSStringFromGADAdSize(GADAdSize size);
FOUNDATION_EXPORT NSString *_Nonnull NSStringFromGADAdSize(GADAdSize size);

/// Returns an NSValue representing the GADAdSize.
extern NSValue *_Nonnull NSValueFromGADAdSize(GADAdSize size);
FOUNDATION_EXPORT NSValue *_Nonnull NSValueFromGADAdSize(GADAdSize size);

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

#pragma mark Deprecated

/// An ad size that spans the full width of the application in portrait orientation. The height is
/// typically 50 points on an iPhone/iPod UI, and 90 points tall on an iPad UI.
extern GADAdSize const kGADAdSizeSmartBannerPortrait
FOUNDATION_EXPORT GADAdSize const kGADAdSizeSmartBannerPortrait
GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth.");

/// An ad size that spans the full width of the application in landscape orientation. The height is
/// typically 32 points on an iPhone/iPod UI, and 90 points tall on an iPad UI.
extern GADAdSize const kGADAdSizeSmartBannerLandscape
FOUNDATION_EXPORT GADAdSize const kGADAdSizeSmartBannerLandscape
GAD_DEPRECATED_MSG_ATTRIBUTE("Use GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth");
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
/// Key for getting the server parameter configured in AdMob when mediating to a custom event
/// adapter.
/// Example: NSString *serverParameter = connector.credentials[GADCustomEventParametersServer].
extern NSString *_Nonnull const GADCustomEventParametersServer;
FOUNDATION_EXPORT NSString *_Nonnull const GADCustomEventParametersServer;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
typedef void (^GADNativeAdCustomClickHandler)(NSString *_Nonnull assetID);

/// Asset key for the GADMediaView asset view.
extern NSString *_Nonnull const GADCustomNativeAdMediaViewKey;
FOUNDATION_EXPORT NSString *_Nonnull const GADCustomNativeAdMediaViewKey;

@protocol GADCustomNativeAdDelegate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

typedef NSString *GADNativeAssetIdentifier NS_STRING_ENUM;

extern GADNativeAssetIdentifier _Nonnull const GADNativeHeadlineAsset;
extern GADNativeAssetIdentifier _Nonnull const GADNativeCallToActionAsset;
extern GADNativeAssetIdentifier _Nonnull const GADNativeIconAsset;
extern GADNativeAssetIdentifier _Nonnull const GADNativeBodyAsset;
extern GADNativeAssetIdentifier _Nonnull const GADNativeStoreAsset;
extern GADNativeAssetIdentifier _Nonnull const GADNativePriceAsset;
extern GADNativeAssetIdentifier _Nonnull const GADNativeImageAsset;
extern GADNativeAssetIdentifier _Nonnull const GADNativeStarRatingAsset;
extern GADNativeAssetIdentifier _Nonnull const GADNativeAdvertiserAsset;
extern GADNativeAssetIdentifier _Nonnull const GADNativeMediaViewAsset;
extern GADNativeAssetIdentifier _Nonnull const GADNativeAdChoicesViewAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativeHeadlineAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativeCallToActionAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativeIconAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativeBodyAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativeStoreAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativePriceAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativeImageAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativeStarRatingAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativeAdvertiserAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativeMediaViewAsset;
FOUNDATION_EXPORT GADNativeAssetIdentifier _Nonnull const GADNativeAdChoicesViewAsset;
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@

#pragma mark - Ad Lifecycle Events

/// Called when an impression is recorded for an ad. Only called for Google ads and is not supported
/// for mediated ads.
/// Called when an impression is recorded for an ad.
- (void)nativeAdDidRecordImpression:(nonnull GADNativeAd *)nativeAd;

/// Called when a click is recorded for an ad. Only called for Google ads and is not supported for
/// mediated ads.
/// Called when a click is recorded for an ad.
- (void)nativeAdDidRecordClick:(nonnull GADNativeAd *)nativeAd;

#pragma mark - Click-Time Lifecycle Notifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
typedef NSString *GADMaxAdContentRating NS_STRING_ENUM;

/// Rating for content suitable for general audiences, including families.
extern GADMaxAdContentRating _Nonnull const GADMaxAdContentRatingGeneral;
FOUNDATION_EXPORT GADMaxAdContentRating _Nonnull const GADMaxAdContentRatingGeneral;
/// Rating for content suitable for most audiences with parental guidance.
extern GADMaxAdContentRating _Nonnull const GADMaxAdContentRatingParentalGuidance;
FOUNDATION_EXPORT GADMaxAdContentRating _Nonnull const GADMaxAdContentRatingParentalGuidance;
/// Rating for content suitable for teen and older audiences.
extern GADMaxAdContentRating _Nonnull const GADMaxAdContentRatingTeen;
FOUNDATION_EXPORT GADMaxAdContentRating _Nonnull const GADMaxAdContentRatingTeen;
/// Rating for content suitable only for mature audiences.
extern GADMaxAdContentRating _Nonnull const GADMaxAdContentRatingMatureAudience;
FOUNDATION_EXPORT GADMaxAdContentRating _Nonnull const GADMaxAdContentRatingMatureAudience;

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

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

0 comments on commit 752b3dd

Please sign in to comment.