@@ -111,7 +111,7 @@ class ReactNativeGoogleMobileAdsModule(
111
111
// it is not clear if that will cause problems even if it happens, but users that have widely deployed this
112
112
// with the use of currentActivity have not seen problems
113
113
// reference if it needs attention: https://github.com/invertase/react-native-google-mobile-ads/pull/664
114
- currentActivity ? : reactApplicationContext,
114
+ reactApplicationContext. currentActivity ? : reactApplicationContext,
115
115
OnInitializationCompleteListener { initializationStatus ->
116
116
val result = Arguments .createArray()
117
117
for ((key, value) in initializationStatus.adapterStatusMap) {
@@ -136,7 +136,7 @@ class ReactNativeGoogleMobileAdsModule(
136
136
137
137
@ReactMethod
138
138
fun openAdInspector (promise : Promise ) {
139
- val activity = currentActivity
139
+ val activity = reactApplicationContext. currentActivity
140
140
if (activity == null ) {
141
141
promise.reject(" null-activity" , " Ad Inspector attempted to open but the current Activity was null." )
142
142
return
@@ -164,8 +164,8 @@ class ReactNativeGoogleMobileAdsModule(
164
164
165
165
@ReactMethod
166
166
fun openDebugMenu (adUnit : String ) {
167
- currentActivity?.runOnUiThread {
168
- MobileAds .openDebugMenu(currentActivity!! , adUnit)
167
+ reactApplicationContext. currentActivity?.runOnUiThread {
168
+ MobileAds .openDebugMenu(reactApplicationContext. currentActivity!! , adUnit)
169
169
}
170
170
}
171
171
0 commit comments