react-native-google-mobile-ads 15.6.0 → 15.7.0
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 +12 -0
- package/docs/displaying-ads.mdx +2 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerComponent.m +8 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerView.mm +18 -0
- 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/types/BannerAdProps.d.ts +8 -0
- package/lib/typescript/types/BannerAdProps.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/ads/BaseAd.tsx +1 -1
- package/src/types/BannerAdProps.ts +10 -0
- package/src/version.ts +1 -1
|
@@ -57,6 +57,8 @@ public class ReactNativeGoogleMobileAdsBannerAdViewManager
|
|
|
57
57
|
extends SimpleViewManager<ReactNativeAdView> {
|
|
58
58
|
private static final String REACT_CLASS = "RNGoogleMobileAdsBannerView";
|
|
59
59
|
private final String EVENT_AD_LOADED = "onAdLoaded";
|
|
60
|
+
private final String EVENT_AD_IMPRESSION = "onAdImpression";
|
|
61
|
+
private final String EVENT_AD_CLICKED = "onAdClicked";
|
|
60
62
|
private final String EVENT_AD_FAILED_TO_LOAD = "onAdFailedToLoad";
|
|
61
63
|
private final String EVENT_AD_OPENED = "onAdOpened";
|
|
62
64
|
private final String EVENT_AD_CLOSED = "onAdClosed";
|
|
@@ -283,6 +285,16 @@ public class ReactNativeGoogleMobileAdsBannerAdViewManager
|
|
|
283
285
|
public void onAdClosed() {
|
|
284
286
|
sendEvent(reactViewGroup, EVENT_AD_CLOSED, null);
|
|
285
287
|
}
|
|
288
|
+
|
|
289
|
+
@Override
|
|
290
|
+
public void onAdImpression() {
|
|
291
|
+
sendEvent(reactViewGroup, EVENT_AD_IMPRESSION, null);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
@Override
|
|
295
|
+
public void onAdClicked() {
|
|
296
|
+
sendEvent(reactViewGroup, EVENT_AD_CLICKED, null);
|
|
297
|
+
}
|
|
286
298
|
});
|
|
287
299
|
if (adView instanceof AdManagerAdView) {
|
|
288
300
|
((AdManagerAdView) adView)
|
package/docs/displaying-ads.mdx
CHANGED
|
@@ -456,6 +456,8 @@ or network triggers an event:
|
|
|
456
456
|
- `onAdFailedToLoad`
|
|
457
457
|
- `onAdLeftApplication`
|
|
458
458
|
- `onAdOpened`
|
|
459
|
+
- `onAdImpression`
|
|
460
|
+
- `onAdClicked`
|
|
459
461
|
- `onPaid` — On [impression-level ad revenue](https://support.google.com/admob/answer/11322405?hl=en) events.
|
|
460
462
|
|
|
461
463
|
Each render of the component loads a single advert, allowing you to display multiple adverts at once. If you need to reload/change
|
|
@@ -184,6 +184,14 @@
|
|
|
184
184
|
[self sendEvent:@"onAdOpened" payload:nil];
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
- (void)bannerViewDidRecordImpression:(GADBannerView *)bannerView {
|
|
188
|
+
[self sendEvent:@"onAdImpression" payload:nil];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
- (void)bannerViewDidRecordClick:(GADBannerView *)bannerView {
|
|
192
|
+
[self sendEvent:@"onAdClicked" payload:nil];
|
|
193
|
+
}
|
|
194
|
+
|
|
187
195
|
- (void)bannerViewWillDismissScreen:(GADBannerView *)bannerView {
|
|
188
196
|
// not in use
|
|
189
197
|
}
|
|
@@ -225,6 +225,24 @@ using namespace facebook::react;
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
- (void)bannerViewDidRecordImpression:(GADBannerView *)bannerView {
|
|
229
|
+
if (_eventEmitter != nullptr) {
|
|
230
|
+
std::dynamic_pointer_cast<const facebook::react::RNGoogleMobileAdsBannerViewEventEmitter>(
|
|
231
|
+
_eventEmitter)
|
|
232
|
+
->onNativeEvent(facebook::react::RNGoogleMobileAdsBannerViewEventEmitter::OnNativeEvent{
|
|
233
|
+
.type = "onAdImpression"});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
- (void)bannerViewDidRecordClick:(GADBannerView *)bannerView {
|
|
238
|
+
if (_eventEmitter != nullptr) {
|
|
239
|
+
std::dynamic_pointer_cast<const facebook::react::RNGoogleMobileAdsBannerViewEventEmitter>(
|
|
240
|
+
_eventEmitter)
|
|
241
|
+
->onNativeEvent(facebook::react::RNGoogleMobileAdsBannerViewEventEmitter::OnNativeEvent{
|
|
242
|
+
.type = "onAdClicked"});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
228
246
|
- (void)bannerViewWillDismissScreen:(GADBannerView *)bannerView {
|
|
229
247
|
// not in use
|
|
230
248
|
}
|
package/lib/commonjs/version.js
CHANGED
package/lib/module/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "15.
|
|
1
|
+
export declare const SDK_VERSION = "15.7.0";
|
|
2
2
|
export { default, MobileAds } from './MobileAds';
|
|
3
3
|
export { AdsConsentDebugGeography, AdsConsentInfo, AdsConsentInfoOptions, AdsConsentInterface, AdsConsentPrivacyOptionsRequirementStatus, AdsConsentStatus, AdsConsentUserChoices, } from './specs/modules/NativeConsentModule';
|
|
4
4
|
export { AdsConsentPurposes } from './AdsConsentPurposes';
|
|
@@ -74,6 +74,14 @@ export interface BannerAdProps {
|
|
|
74
74
|
* The ad is now visible to the user.
|
|
75
75
|
*/
|
|
76
76
|
onAdOpened?: () => void;
|
|
77
|
+
/**
|
|
78
|
+
* Called when an impression is recorded for an ad.
|
|
79
|
+
*/
|
|
80
|
+
onAdImpression?: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* Called when a click is recorded for an ad
|
|
83
|
+
*/
|
|
84
|
+
onAdClicked?: () => void;
|
|
77
85
|
/**
|
|
78
86
|
* Called when the user is about to return to the app after tapping on an ad.
|
|
79
87
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerAdProps.d.ts","sourceRoot":"","sources":["../../../src/types/BannerAdProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,IAAI,EAAE,YAAY,GAAG,MAAM,CAAC;IAE5B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAErE;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAE1C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACxE;AAED;;;;;;;;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KAAK,IAAI,CAAC;IAE1C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACxE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;IACnE;;;;OAIG;IACH,KAAK,EAAE,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC;IAE3E;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC3C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "15.
|
|
1
|
+
export declare const version = "15.7.0";
|
|
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": "15.
|
|
3
|
+
"version": "15.7.0",
|
|
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/ads/BaseAd.tsx
CHANGED
|
@@ -80,6 +80,16 @@ export interface BannerAdProps {
|
|
|
80
80
|
*/
|
|
81
81
|
onAdOpened?: () => void;
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Called when an impression is recorded for an ad.
|
|
85
|
+
*/
|
|
86
|
+
onAdImpression?: () => void;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Called when a click is recorded for an ad
|
|
90
|
+
*/
|
|
91
|
+
onAdClicked?: () => void;
|
|
92
|
+
|
|
83
93
|
/**
|
|
84
94
|
* Called when the user is about to return to the app after tapping on an ad.
|
|
85
95
|
*/
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '15.
|
|
2
|
+
export const version = '15.7.0';
|