react-native-google-mobile-ads 10.1.0 → 10.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsBannerAdViewManager.java +9 -3
- package/android/src/main/java/io/invertase/googlemobileads/common/ReactNativeAdView.java +3 -13
- package/lib/commonjs/version.js +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/version.ts +1 -1
|
@@ -20,6 +20,7 @@ package io.invertase.googlemobileads;
|
|
|
20
20
|
import android.view.ViewGroup;
|
|
21
21
|
import androidx.annotation.NonNull;
|
|
22
22
|
import com.facebook.react.bridge.Arguments;
|
|
23
|
+
import com.facebook.react.bridge.ReactContext;
|
|
23
24
|
import com.facebook.react.bridge.ReadableArray;
|
|
24
25
|
import com.facebook.react.bridge.ReadableMap;
|
|
25
26
|
import com.facebook.react.bridge.WritableMap;
|
|
@@ -42,6 +43,7 @@ import io.invertase.googlemobileads.common.ReactNativeAdView;
|
|
|
42
43
|
import java.util.ArrayList;
|
|
43
44
|
import java.util.List;
|
|
44
45
|
import java.util.Map;
|
|
46
|
+
import java.util.Objects;
|
|
45
47
|
import javax.annotation.Nonnull;
|
|
46
48
|
import javax.annotation.Nullable;
|
|
47
49
|
|
|
@@ -156,7 +158,12 @@ public class ReactNativeGoogleMobileAdsBannerAdViewManager
|
|
|
156
158
|
}
|
|
157
159
|
BaseAdView adView;
|
|
158
160
|
if (ReactNativeGoogleMobileAdsCommon.isAdManagerUnit(reactViewGroup.getUnitId())) {
|
|
159
|
-
|
|
161
|
+
// in order to display the debug menu for GAM ads we need the activity context
|
|
162
|
+
// https://github.com/invertase/react-native-google-mobile-ads/issues/188
|
|
163
|
+
adView =
|
|
164
|
+
new AdManagerAdView(
|
|
165
|
+
Objects.requireNonNull(
|
|
166
|
+
((ReactContext) reactViewGroup.getContext()).getCurrentActivity()));
|
|
160
167
|
} else {
|
|
161
168
|
adView = new AdView(reactViewGroup.getContext());
|
|
162
169
|
}
|
|
@@ -267,8 +274,7 @@ public class ReactNativeGoogleMobileAdsBannerAdViewManager
|
|
|
267
274
|
event.merge(payload);
|
|
268
275
|
}
|
|
269
276
|
|
|
270
|
-
reactViewGroup
|
|
271
|
-
.getReactContext()
|
|
277
|
+
((ThemedReactContext) reactViewGroup.getContext())
|
|
272
278
|
.getJSModule(RCTEventEmitter.class)
|
|
273
279
|
.receiveEvent(reactViewGroup.getId(), "onNativeEvent", event);
|
|
274
280
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
package io.invertase.googlemobileads.common;
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import android.content.Context;
|
|
4
4
|
import com.facebook.react.views.view.ReactViewGroup;
|
|
5
5
|
import com.google.android.gms.ads.AdRequest;
|
|
6
6
|
import com.google.android.gms.ads.AdSize;
|
|
@@ -13,11 +13,9 @@ public class ReactNativeAdView extends ReactViewGroup {
|
|
|
13
13
|
private boolean manualImpressionsEnabled;
|
|
14
14
|
private boolean propsChanged;
|
|
15
15
|
private boolean isFluid;
|
|
16
|
-
private ThemedReactContext reactContext;
|
|
17
16
|
|
|
18
|
-
public ReactNativeAdView(final
|
|
19
|
-
super(context
|
|
20
|
-
setReactContext(context);
|
|
17
|
+
public ReactNativeAdView(final Context context) {
|
|
18
|
+
super(context);
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
public void setRequest(AdRequest request) {
|
|
@@ -67,12 +65,4 @@ public class ReactNativeAdView extends ReactViewGroup {
|
|
|
67
65
|
public boolean getIsFluid() {
|
|
68
66
|
return this.isFluid;
|
|
69
67
|
}
|
|
70
|
-
|
|
71
|
-
public ThemedReactContext getReactContext() {
|
|
72
|
-
return reactContext;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public void setReactContext(ThemedReactContext reactContext) {
|
|
76
|
-
this.reactContext = reactContext;
|
|
77
|
-
}
|
|
78
68
|
}
|
package/lib/commonjs/version.js
CHANGED
package/lib/module/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "10.1.
|
|
1
|
+
export declare const SDK_VERSION = "10.1.2";
|
|
2
2
|
export { default, MobileAds } from './MobileAds';
|
|
3
3
|
export { AdsConsentDebugGeography } from './AdsConsentDebugGeography';
|
|
4
4
|
export { AdsConsentPurposes } from './AdsConsentPurposes';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "10.1.
|
|
1
|
+
export declare const version = "10.1.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-google-mobile-ads",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.2",
|
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
|
5
5
|
"description": "React Native Google Mobile Ads is an easy way to monetize mobile apps with targeted, in-app advertising.",
|
|
6
6
|
"main": "lib/commonjs/index.js",
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '10.1.
|
|
2
|
+
export const version = '10.1.2';
|