react-native-google-mobile-ads 13.3.0 → 13.4.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/OnNativeEvent.kt +1 -1
- package/docs/displaying-ads.mdx +23 -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 +7 -7
- package/src/version.ts +1 -1
package/docs/displaying-ads.mdx
CHANGED
|
@@ -399,18 +399,33 @@ The module exposes a [`BannerAd`](/reference/admob/bannerad) component. The `uni
|
|
|
399
399
|
a banner:
|
|
400
400
|
|
|
401
401
|
```js
|
|
402
|
-
import React from 'react';
|
|
402
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
403
|
+
import { AppState } from 'react-native';
|
|
403
404
|
import { BannerAd, BannerAdSize, TestIds } from 'react-native-google-mobile-ads';
|
|
404
405
|
|
|
405
406
|
const adUnitId = __DEV__ ? TestIds.ADAPTIVE_BANNER : 'ca-app-pub-xxxxxxxxxxxxx/yyyyyyyyyyyyyy';
|
|
406
407
|
|
|
407
408
|
function App() {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
409
|
+
const appState = useRef(AppState.currentState);
|
|
410
|
+
const [key, setKey] = useState(`banner-${Date.now()}`);
|
|
411
|
+
|
|
412
|
+
// WKWebView can terminate if app is in a "suspended state", resulting in an empty banner when app returns to foreground.
|
|
413
|
+
// A Google Mobile Ads Advisor suggests requesting a new ad when the app is foregrounded.
|
|
414
|
+
// For more details, see: [https://groups.google.com/g/google-admob-ads-sdk/c/rwBpqOUr8m8]
|
|
415
|
+
useEffect(() => {
|
|
416
|
+
const subscription = AppState.addEventListener('change', nextAppState => {
|
|
417
|
+
if (appState.current.match(/background/) && nextAppState === 'active') {
|
|
418
|
+
setKey(`banner-${Date.now()}`);
|
|
419
|
+
}
|
|
420
|
+
appState.current = nextAppState;
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
return () => {
|
|
424
|
+
subscription.remove();
|
|
425
|
+
};
|
|
426
|
+
}, []);
|
|
427
|
+
|
|
428
|
+
return <BannerAd key={key} unitId={adUnitId} size={BannerAdSize.ANCHORED_ADAPTIVE_BANNER} />;
|
|
414
429
|
}
|
|
415
430
|
```
|
|
416
431
|
|
|
@@ -473,12 +488,7 @@ import { GAMBannerAd, BannerAdSize, TestIds } from 'react-native-google-mobile-a
|
|
|
473
488
|
const adUnitId = __DEV__ ? TestIds.GAM_BANNER : '/xxx/yyyy';
|
|
474
489
|
|
|
475
490
|
function App() {
|
|
476
|
-
return
|
|
477
|
-
<GAMBannerAd
|
|
478
|
-
unitId={adUnitId}
|
|
479
|
-
sizes={[BannerAdSize.FULL_BANNER]}
|
|
480
|
-
/>
|
|
481
|
-
);
|
|
491
|
+
return <GAMBannerAd unitId={adUnitId} sizes={[BannerAdSize.FULL_BANNER]} />;
|
|
482
492
|
}
|
|
483
493
|
```
|
|
484
494
|
|
package/lib/commonjs/version.js
CHANGED
package/lib/module/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "13.
|
|
1
|
+
export declare const SDK_VERSION = "13.4.0";
|
|
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 = "13.
|
|
1
|
+
export declare const version = "13.4.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": "13.
|
|
3
|
+
"version": "13.4.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",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
],
|
|
42
42
|
"sdkVersions": {
|
|
43
43
|
"ios": {
|
|
44
|
-
"googleMobileAds": "11.
|
|
45
|
-
"googleUmp": "2.
|
|
44
|
+
"googleMobileAds": "11.5.0",
|
|
45
|
+
"googleUmp": "2.4.0"
|
|
46
46
|
},
|
|
47
47
|
"android": {
|
|
48
48
|
"minSdk": 21,
|
|
49
|
-
"targetSdk":
|
|
50
|
-
"compileSdk":
|
|
51
|
-
"buildTools": "
|
|
52
|
-
"googleMobileAds": "23.
|
|
49
|
+
"targetSdk": 34,
|
|
50
|
+
"compileSdk": 34,
|
|
51
|
+
"buildTools": "34.0.0",
|
|
52
|
+
"googleMobileAds": "23.1.0",
|
|
53
53
|
"googleUmp": "2.2.0"
|
|
54
54
|
}
|
|
55
55
|
},
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '13.
|
|
2
|
+
export const version = '13.4.0';
|