From 753d75352669ad27511a85fce8eeaabff3179f0a Mon Sep 17 00:00:00 2001 From: David Taylor Date: Sun, 20 Jun 2021 00:07:15 -0400 Subject: [PATCH 1/2] Fixes for RewardedAd Api definitions --- source/Google/MobileAds/ApiDefinition.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/Google/MobileAds/ApiDefinition.cs b/source/Google/MobileAds/ApiDefinition.cs index 689a3d084..cdfc15739 100644 --- a/source/Google/MobileAds/ApiDefinition.cs +++ b/source/Google/MobileAds/ApiDefinition.cs @@ -509,8 +509,11 @@ interface ResponseInfo // typedef void (^GADRewardedAdLoadCompletionHandler)(GADRewardedAd *_Nullable rewardedAd, NSError *_Nullable error); delegate void RewardedAdLoadCompletionHandler ([NullAllowed] RewardedAd rewardedAd, [NullAllowed] NSError error); + // typedef void (^GADUserDidEarnRewardHandler)(void) + delegate void UserDidEarnRewardHandler (); + // @interface GADRewardedAd : NSObject - [BaseType (typeof (FullScreenContentDelegate), Name = "GADRewardedAd")] + [BaseType (typeof (FullScreenPresentingAd), Name = "GADRewardedAd")] interface RewardedAd : AdMetadataProvider { // + (void)loadWithAdUnitID:(nonnull NSString *)adUnitID request:(nullable GADRequest *)request completionHandler:(nonnull GADRewardedAdLoadCompletionHandler)completionHandler; [Async] @@ -527,10 +530,9 @@ interface RewardedAd : AdMetadataProvider { [Export ("responseInfo")] ResponseInfo ResponseInfo { get; } - // @property (readonly, nonatomic) GADAdReward * _Nullable reward; - [NullAllowed] - [Export ("reward")] - AdReward Reward { get; } + // @property (readonly, nonatomic, nonnull) GADAdReward *adReward; + [Export ("adReward")] + AdReward AdReward { get; } // @property (nonatomic, nullable) GADServerSideVerificationOptions *serverSideVerificationOptions; [NullAllowed] @@ -546,9 +548,9 @@ interface RewardedAd : AdMetadataProvider { [Export ("canPresentFromRootViewController:error:")] bool CanPresent (UIViewController rootViewController, [NullAllowed] out NSError error); - // -(void)presentFromRootViewController:(UIViewController * _Nonnull)viewController delegate:(id _Nonnull)delegate; - [Export ("presentFromRootViewController:delegate:")] - void Present (UIViewController viewController, IRewardedAdDelegate @delegate); + // -(void)presentFromRootViewController:(nonnull UIViewController *)rootViewController userDidEarnRewardHandler:(nonnull GADUserDidEarnRewardHandler)userDidEarnRewardHandler; + [Export ("presentFromRootViewController:userDidEarnRewardHandler:")] + void Present (UIViewController viewController, UserDidEarnRewardHandler userDidEarnRewardHandler); [Export ("adMetadata")] NSDictionary AdMetadata { get; } From be1b63dd7c4d11d6943ff388d0030d65e8fba608 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Sun, 20 Jun 2021 10:07:48 -0400 Subject: [PATCH 2/2] Fixes for adaptive ad banner bindings --- source/Google/MobileAds/Extensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Google/MobileAds/Extensions.cs b/source/Google/MobileAds/Extensions.cs index acc0f851e..70e753d59 100644 --- a/source/Google/MobileAds/Extensions.cs +++ b/source/Google/MobileAds/Extensions.cs @@ -42,15 +42,15 @@ public partial class AdSizeCons { //GAD_EXTERN GADAdSize GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth (CGFloat width); [DllImport ("__Internal", EntryPoint = "GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth")] - public static extern AdSize GetPortraitAnchoredAdaptiveBannerAdSize (CGSize size); + public static extern AdSize GetPortraitAnchoredAdaptiveBannerAdSize (nfloat width); //GAD_EXTERN GADAdSize GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth (CGFloat width); [DllImport ("__Internal", EntryPoint = "GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth")] - public static extern AdSize GetLandscapeAnchoredAdaptiveBannerAdSize (CGSize size); + public static extern AdSize GetLandscapeAnchoredAdaptiveBannerAdSize (nfloat width); //GAD_EXTERN GADAdSize GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth (CGFloat width); [DllImport ("__Internal", EntryPoint = "GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth")] - public static extern AdSize GetCurrentOrientationAnchoredAdaptiveBannerAdSize (CGSize size); + public static extern AdSize GetCurrentOrientationAnchoredAdaptiveBannerAdSize (nfloat width); // GADAdSize GADAdSizeFromCGSize(CGSize size); [DllImport ("__Internal", EntryPoint = "GADAdSizeFromCGSize")]