react-native-google-mobile-ads 12.7.0 → 12.7.1

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.
@@ -158,6 +158,20 @@ public class ReactNativeGoogleMobileAdsBannerAdViewManager
158
158
  reactViewGroup.setPropsChanged(false);
159
159
  }
160
160
 
161
+ @Override
162
+ public void onDropViewInstance(@NonNull ReactNativeAdView reactViewGroup) {
163
+ BaseAdView adView = getAdView(reactViewGroup);
164
+ if (adView != null) {
165
+ adView.setAdListener(null);
166
+ if (adView instanceof AdManagerAdView) {
167
+ ((AdManagerAdView) adView).setAppEventListener(null);
168
+ }
169
+ adView.destroy();
170
+ reactViewGroup.removeView(adView);
171
+ }
172
+ super.onDropViewInstance(reactViewGroup);
173
+ }
174
+
161
175
  private BaseAdView initAdView(ReactNativeAdView reactViewGroup) {
162
176
  BaseAdView oldAdView = getAdView(reactViewGroup);
163
177
  if (oldAdView != null) {
@@ -144,18 +144,6 @@ async function startGoogleMobileAdsSDK() {
144
144
 
145
145
  // Request an ad...
146
146
  }
147
-
148
- const consentInfo = await AdsConsent.requestInfoUpdate();
149
-
150
- const { canRequestAds } = await AdsConsent.loadAndShowConsentFormIfRequired();
151
-
152
- if (canRequestAds) {
153
- // (iOS) Handle Apple's App Tracking Transparency.
154
-
155
- // Initialize the Google Mobile Ads SDK.
156
-
157
- // Request an ad...
158
- }
159
147
  ```
160
148
 
161
149
  > Do not persist the status. You could however store this locally in application state (e.g. React Context) and update the status on every app launch as it may change.
@@ -23,6 +23,13 @@
23
23
 
24
24
  @implementation RNGoogleMobileAdsBannerComponent
25
25
 
26
+ - (void)dealloc {
27
+ if (_banner) {
28
+ [_banner removeFromSuperview];
29
+ _banner = nil;
30
+ }
31
+ }
32
+
26
33
  - (void)didSetProps:(NSArray<NSString *> *)changedProps {
27
34
  if (_propsChanged) {
28
35
  [self requestAd];
@@ -94,6 +94,13 @@ using namespace facebook::react;
94
94
  [super updateProps:props oldProps:oldProps];
95
95
  }
96
96
 
97
+ - (void)dealloc {
98
+ if (_banner) {
99
+ [_banner removeFromSuperview];
100
+ _banner = nil;
101
+ }
102
+ }
103
+
97
104
  #pragma mark - Methods
98
105
 
99
106
  - (void)initBanner:(GADAdSize)adSize {
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- const version = '12.7.0';
8
+ const version = '12.7.1';
9
9
  exports.version = version;
10
10
  //# sourceMappingURL=version.js.map
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '12.7.0';
2
+ export const version = '12.7.1';
3
3
  //# sourceMappingURL=version.js.map
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "12.7.0";
1
+ export declare const SDK_VERSION = "12.7.1";
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 = "12.7.0";
1
+ export declare const version = "12.7.1";
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": "12.7.0",
3
+ "version": "12.7.1",
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 = '12.7.0';
2
+ export const version = '12.7.1';