@@ -111,7 +111,7 @@ class ReactNativeGoogleMobileAdsModule(
111111 // it is not clear if that will cause problems even if it happens, but users that have widely deployed this
112112 // with the use of currentActivity have not seen problems
113113 // reference if it needs attention: https://github.com/invertase/react-native-google-mobile-ads/pull/664
114- currentActivity ? : reactApplicationContext,
114+ reactApplicationContext. currentActivity ? : reactApplicationContext,
115115 OnInitializationCompleteListener { initializationStatus ->
116116 val result = Arguments .createArray()
117117 for ((key, value) in initializationStatus.adapterStatusMap) {
@@ -136,7 +136,7 @@ class ReactNativeGoogleMobileAdsModule(
136136
137137 @ReactMethod
138138 fun openAdInspector (promise : Promise ) {
139- val activity = currentActivity
139+ val activity = reactApplicationContext. currentActivity
140140 if (activity == null ) {
141141 promise.reject(" null-activity" , " Ad Inspector attempted to open but the current Activity was null." )
142142 return
@@ -164,8 +164,8 @@ class ReactNativeGoogleMobileAdsModule(
164164
165165 @ReactMethod
166166 fun openDebugMenu (adUnit : String ) {
167- currentActivity?.runOnUiThread {
168- MobileAds .openDebugMenu(currentActivity!! , adUnit)
167+ reactApplicationContext. currentActivity?.runOnUiThread {
168+ MobileAds .openDebugMenu(reactApplicationContext. currentActivity!! , adUnit)
169169 }
170170 }
171171
0 commit comments