From 1a1a778d7c8062df2f3d802e519fe18ec52df345 Mon Sep 17 00:00:00 2001 From: Taylor Dale <5500716+TaylorDale@users.noreply.github.com> Date: Sun, 1 Dec 2024 22:11:31 +1000 Subject: [PATCH] Opportunistically use currentactivity Required for Unity Ads to function, as far as I can see shouldn't effect anything else --- .../googlemobileads/ReactNativeGoogleMobileAdsModule.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.kt b/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.kt index c3a330da..26608868 100644 --- a/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.kt +++ b/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.kt @@ -95,7 +95,7 @@ class ReactNativeGoogleMobileAdsModule( @ReactMethod fun initialize(promise: Promise) { MobileAds.initialize( - reactApplicationContext, + currentActivity ?: reactApplicationContext, OnInitializationCompleteListener { initializationStatus -> val result = Arguments.createArray() for ((key, value) in initializationStatus.adapterStatusMap) {