From 3154579cd51a7ca98e747a1d73caf0ecd9ad4e2f Mon Sep 17 00:00:00 2001 From: "Dr. Sergey Pogodin" Date: Mon, 24 Jan 2022 11:54:49 +0100 Subject: [PATCH] fix(android): no banner ads loaded in the first render * Fix: no banner ads loaded on Android in the initial render https://github.com/invertase/react-native-google-ads/issues/58 --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .../googleads/ReactNativeGoogleAdsBannerAdViewManager.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1746cac1..91ba637d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -33,7 +33,7 @@ --- -Think `react-native-admob` is great? Please consider supporting the project with any of the below: +Think `react-native-google-ads` is great? Please consider supporting the project with any of the below: - 👉 Star this repo on GitHub ⭐️ - 👉 Follow [`Invertase`](https://twitter.com/invertaseio) on Twitter diff --git a/android/src/main/java/io/invertase/googleads/ReactNativeGoogleAdsBannerAdViewManager.java b/android/src/main/java/io/invertase/googleads/ReactNativeGoogleAdsBannerAdViewManager.java index 8363084d..23a4b457 100644 --- a/android/src/main/java/io/invertase/googleads/ReactNativeGoogleAdsBannerAdViewManager.java +++ b/android/src/main/java/io/invertase/googleads/ReactNativeGoogleAdsBannerAdViewManager.java @@ -87,11 +87,13 @@ public Map getExportedCustomDirectEventTypeConstants() { @ReactProp(name = "unitId") public void setUnitId(ReactViewGroup reactViewGroup, String value) { unitId = value; + requestAd(reactViewGroup); } @ReactProp(name = "request") public void setRequest(ReactViewGroup reactViewGroup, ReadableMap value) { request = ReactNativeGoogleAdsCommon.buildAdRequest(value); + requestAd(reactViewGroup); } @ReactProp(name = "size")