@react-native-firebase/app 21.4.1 → 21.6.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [21.6.0](https://github.com/invertase/react-native-firebase/compare/v21.5.0...v21.6.0) (2024-11-20)
7
+
8
+ ### Features
9
+
10
+ - **ios, sdk:** allow FIREBASE_SDK_VERSION override ([8cbe59f](https://github.com/invertase/react-native-firebase/commit/8cbe59fbf771df6ba932832c9d4fd17bf500ea91))
11
+
12
+ ### Bug Fixes
13
+
14
+ - **analytics:** update superstruct dependency / forward-port to new API ([#8153](https://github.com/invertase/react-native-firebase/issues/8153)) ([6db1fb4](https://github.com/invertase/react-native-firebase/commit/6db1fb471e62e2c7e434719f2616c76349f345be))
15
+
16
+ ## [21.5.0](https://github.com/invertase/react-native-firebase/compare/v21.4.1...v21.5.0) (2024-11-16)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **android:** forward-port to non-deprecated data collection API ([2c87eeb](https://github.com/invertase/react-native-firebase/commit/2c87eeb3f0e8053ab02d4f6cce047ad61a6310fa))
21
+ - **android:** rn74 forward-port onCatalystInstanceDestroy -> invalidate ([83696ea](https://github.com/invertase/react-native-firebase/commit/83696ea4c944b2be0b8fd9f2fc1db212800cbcf8))
22
+
6
23
  ## [21.4.1](https://github.com/invertase/react-native-firebase/compare/v21.4.0...v21.4.1) (2024-11-13)
7
24
 
8
25
  ### Bug Fixes
package/RNFBApp.podspec CHANGED
@@ -27,6 +27,11 @@ Pod::Spec.new do |s|
27
27
  # React Native dependencies
28
28
  s.dependency 'React-Core'
29
29
 
30
+ if (ENV.include?('FIREBASE_SDK_VERSION'))
31
+ Pod::UI.puts "#{s.name}: Found Firebase SDK version in environment '#{ENV['FIREBASE_SDK_VERSION']}'"
32
+ $FirebaseSDKVersion = ENV['FIREBASE_SDK_VERSION']
33
+ end
34
+
30
35
  if defined?($FirebaseSDKVersion)
31
36
  Pod::UI.puts "#{s.name}: Using user specified Firebase SDK version '#{$FirebaseSDKVersion}'"
32
37
  firebase_sdk_version = $FirebaseSDKVersion
@@ -18,5 +18,5 @@ package io.invertase.firebase.app;
18
18
  */
19
19
  // generated file - do not modify or commit
20
20
  public class ReactNativeFirebaseVersion {
21
- public static String VERSION = "21.4.1";
21
+ public static String VERSION = "21.6.0";
22
22
  }
@@ -98,7 +98,7 @@ public class RCTConvertFirebase {
98
98
 
99
99
  if (appConfig.hasKey("automaticDataCollectionEnabled")) {
100
100
  firebaseApp.setDataCollectionDefaultEnabled(
101
- appConfig.getBoolean("automaticDataCollectionEnabled"));
101
+ Boolean.valueOf(appConfig.getBoolean("automaticDataCollectionEnabled")));
102
102
  }
103
103
 
104
104
  if (appConfig.hasKey("automaticResourceManagement")) {
@@ -92,9 +92,26 @@ public class ReactNativeFirebaseModule extends ReactContextBaseJavaModule
92
92
  return executorService.getTransactionalExecutor(identifier);
93
93
  }
94
94
 
95
- @Override
96
- @CallSuper
95
+
96
+ // This is no longer called as of react-native 0.74 and is only here for
97
+ // compatibility with older versions. It delegates to thew new `invalidate`
98
+ // method, which all modules should implement now
99
+ // Remove this method when minimum supported react-native is 0.74
100
+ /** @noinspection removal*/
101
+ @SuppressWarnings({"deprecation", "removal"})
102
+ @Deprecated
97
103
  public void onCatalystInstanceDestroy() {
104
+ // This should call the child class invalidate, which will then call super.invalidate,
105
+ // and everything will work correctly up and down the inheritance hierarchy to shut down
106
+ invalidate();
107
+ }
108
+
109
+ // This should have an @Override annotation but we cannot do
110
+ // that until our minimum supported react-native version is 0.74, since the
111
+ // method did not exist before then
112
+ @CallSuper
113
+ public void invalidate() {
114
+ super.invalidate();
98
115
  executorService.shutdown();
99
116
  }
100
117
 
@@ -17,6 +17,7 @@ package io.invertase.firebase.common;
17
17
  *
18
18
  */
19
19
 
20
+ import android.annotation.SuppressLint;
20
21
  import android.app.ActivityManager;
21
22
  import android.content.Context;
22
23
  import android.graphics.Point;
@@ -181,6 +182,7 @@ public class SharedUtils {
181
182
  return false;
182
183
  }
183
184
 
185
+ @SuppressLint("DiscouragedApi")
184
186
  public static int getResId(Context ctx, String resName) {
185
187
  int resourceId = ctx.getResources().getIdentifier(resName, "string", ctx.getPackageName());
186
188
 
@@ -18,4 +18,4 @@
18
18
  #import <React/RCTVersion.h>
19
19
 
20
20
  // generated file - do not modify or commit
21
- NSString* const RNFBVersionString = @"21.4.1";
21
+ NSString* const RNFBVersionString = @"21.6.0";
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '21.4.1';
2
+ module.exports = '21.6.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/app",
3
- "version": "21.4.1",
3
+ "version": "21.6.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Storage and more.",
6
6
  "main": "lib/index.js",
@@ -57,8 +57,7 @@
57
57
  "react-native": "*"
58
58
  },
59
59
  "dependencies": {
60
- "firebase": "10.13.2",
61
- "superstruct": "^0.6.2"
60
+ "firebase": "10.13.2"
62
61
  },
63
62
  "devDependencies": {
64
63
  "@react-native-async-storage/async-storage": "^1.24.0",
@@ -90,5 +89,5 @@
90
89
  "playServicesAuth": "21.2.0"
91
90
  }
92
91
  },
93
- "gitHead": "1c4301c4f57fe6fe8235e73e13a523ad1af156ad"
92
+ "gitHead": "0103e12714de3c106128859eeadaf0fe07f9674c"
94
93
  }
@@ -1,52 +0,0 @@
1
- /*
2
- * Copyright (c) 2016-present Invertase Limited & Contributors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this library except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import { superstruct } from 'superstruct/lib/index';
18
- import { isUndefined } from './validate';
19
-
20
- export default superstruct({
21
- types: {
22
- shortDate: value => typeof value === 'string' && !!value.match(/^\d{4}-\d{2}-\d{2}$/),
23
- },
24
- });
25
-
26
- export const validateStruct = (value = {}, struct, prefix = '') => {
27
- try {
28
- return struct(value);
29
- } catch (e) {
30
- const { path, reason } = e;
31
- const key = path[0];
32
-
33
- if (reason === undefined) {
34
- throw new Error(`${prefix} unknown property '${key}'.`);
35
- }
36
-
37
- e.message = `${prefix} ${e.message}`;
38
-
39
- throw e;
40
- }
41
- };
42
-
43
- export const validateCompound = (source = {}, a, b, prefix = '') => {
44
- if (
45
- (isUndefined(source[a]) && !isUndefined(source[b])) ||
46
- (!isUndefined(source[a]) && isUndefined(source[b]))
47
- ) {
48
- throw new Error(
49
- `${prefix} if you supply the '${a}' parameter, you must also supply the '${b}' parameter.`,
50
- );
51
- }
52
- };