From 2afd118db8db1e32d5aa9f3e208b148144e0c721 Mon Sep 17 00:00:00 2001 From: Dylan Companjen Date: Sun, 12 Dec 2021 21:41:11 +0100 Subject: [PATCH] feat: replace v7 methods with v8 methods --- ios/RNGoogleAds/RNGoogleAdsBannerViewManager.m | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ios/RNGoogleAds/RNGoogleAdsBannerViewManager.m b/ios/RNGoogleAds/RNGoogleAdsBannerViewManager.m index 4eff0d21..b41fed71 100644 --- a/ios/RNGoogleAds/RNGoogleAdsBannerViewManager.m +++ b/ios/RNGoogleAds/RNGoogleAdsBannerViewManager.m @@ -100,35 +100,31 @@ - (void)sendEvent:(NSString *)type payload:(NSDictionary *_Nullable)payload { self.onNativeEvent(event); } -- (void)adViewDidReceiveAd:(GADBannerView *)adView { +- (void)bannerViewDidReceiveAd:(GADBannerView *)bannerView { [self sendEvent:@"onAdLoaded" payload:@{ - @"width" : @(adView.bounds.size.width), - @"height" : @(adView.bounds.size.height), + @"width" : @(bannerView.bounds.size.width), + @"height" : @(bannerView.bounds.size.height), }]; } -- (void)adView:(GADBannerView *)adView didFailToReceiveAdWithError:(NSError *)error { +- (void)bannerView:(GADBannerView *)bannerView didFailToReceiveAdWithError:(NSError *)error { NSDictionary *errorAndMessage = [RNGoogleAdsCommon getCodeAndMessageFromAdError:error]; [self sendEvent:@"onAdFailedToLoad" payload:errorAndMessage]; } -- (void)adViewWillPresentScreen:(GADBannerView *)adView { +- (void)bannerViewWillPresentScreen:(GADBannerView *)bannerView { [self sendEvent:@"onAdOpened" payload:nil]; } -- (void)adViewWillDismissScreen:(GADBannerView *)adView { +- (void)bannerViewWillDismissScreen:(GADBannerView *)bannerView { // not in use } -- (void)adViewDidDismissScreen:(GADBannerView *)adView { +- (void)bannerViewDidDismissScreen:(GADBannerView *)bannerView { [self sendEvent:@"onAdClosed" payload:nil]; } -- (void)adViewWillLeaveApplication:(GADBannerView *)adView { - [self sendEvent:@"onAdLeftApplication" payload:nil]; -} - @end @implementation RNGoogleAdsBannerViewManager