@react-native-firebase/app 21.8.0 → 21.9.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/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
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.9.0](https://github.com/invertase/react-native-firebase/compare/v21.8.0...v21.9.0) (2025-02-11)
7
+
8
+ ### Features
9
+
10
+ - **app, expo:** support rn77 AppDelegate.swift in config plugin ([#8324](https://github.com/invertase/react-native-firebase/issues/8324)) ([6a7867c](https://github.com/invertase/react-native-firebase/commit/6a7867c9366b851a6de62cc37b7834090caad98b))
11
+
12
+ ### Bug Fixes
13
+
14
+ - firebase-ios-sdk 11.8.0 / firebase-android-sdk 33.9.0 ([67aba08](https://github.com/invertase/react-native-firebase/commit/67aba08c00aa46b72fcb1353bd428fa552b6686a))
15
+
6
16
  ## [21.8.0](https://github.com/invertase/react-native-firebase/compare/v21.7.4...v21.8.0) (2025-02-10)
7
17
 
8
18
  ### Bug Fixes
@@ -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.8.0";
21
+ public static String VERSION = "21.9.0";
22
22
  }
@@ -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.8.0";
21
+ NSString* const RNFBVersionString = @"21.9.0";
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '21.8.0';
2
+ module.exports = '21.9.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/app",
3
- "version": "21.8.0",
3
+ "version": "21.9.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,11 +57,11 @@
57
57
  "react-native": "*"
58
58
  },
59
59
  "dependencies": {
60
- "firebase": "11.2.0"
60
+ "firebase": "11.3.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@react-native-async-storage/async-storage": "^2.1.1",
64
- "expo": "^52.0.30"
64
+ "expo": "^52.0.32"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "expo": {
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "sdkVersions": {
75
75
  "ios": {
76
- "firebase": "11.7.0",
76
+ "firebase": "11.8.0",
77
77
  "iosTarget": "13.0",
78
78
  "macosTarget": "10.15",
79
79
  "tvosTarget": "13.0"
@@ -82,13 +82,13 @@
82
82
  "minSdk": 21,
83
83
  "targetSdk": 34,
84
84
  "compileSdk": 34,
85
- "firebase": "33.8.0",
86
- "firebaseCrashlyticsGradle": "3.0.2",
85
+ "firebase": "33.9.0",
86
+ "firebaseCrashlyticsGradle": "3.0.3",
87
87
  "firebasePerfGradle": "1.4.2",
88
88
  "gmsGoogleServicesGradle": "4.4.2",
89
89
  "playServicesAuth": "21.3.0",
90
- "firebaseAppDistributionGradle": "5.1.0"
90
+ "firebaseAppDistributionGradle": "5.1.1"
91
91
  }
92
92
  },
93
- "gitHead": "14ebd5c2d2e0f284397c331f909e533c47f2ec62"
93
+ "gitHead": "306d9c766ff5614fff6404be5c3dd4bcdb450754"
94
94
  }
@@ -1,5 +1,6 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
2
  import { AppDelegateProjectFile } from '@expo/config-plugins/build/ios/Paths';
3
3
  export declare function modifyObjcAppDelegate(contents: string): string;
4
+ export declare function modifySwiftAppDelegate(contents: string): string;
4
5
  export declare function modifyAppDelegateAsync(appDelegateFileInfo: AppDelegateProjectFile): Promise<void>;
5
6
  export declare const withFirebaseAppDelegate: ConfigPlugin;
@@ -5,17 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.withFirebaseAppDelegate = void 0;
7
7
  exports.modifyObjcAppDelegate = modifyObjcAppDelegate;
8
+ exports.modifySwiftAppDelegate = modifySwiftAppDelegate;
8
9
  exports.modifyAppDelegateAsync = modifyAppDelegateAsync;
9
10
  const config_plugins_1 = require("@expo/config-plugins");
10
11
  const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
11
12
  const fs_1 = __importDefault(require("fs"));
12
- const methodInvocationBlock = `[FIRApp configure];`;
13
- // https://regex101.com/r/mPgaq6/1
14
- const methodInvocationLineMatcher = /(?:self\.moduleName\s*=\s*@\"([^"]*)\";)|(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;
15
- // https://regex101.com/r/nHrTa9/1/
16
- // if the above regex fails, we can use this one as a fallback:
17
- const fallbackInvocationLineMatcher = /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g;
18
13
  function modifyObjcAppDelegate(contents) {
14
+ const methodInvocationBlock = `[FIRApp configure];`;
15
+ // https://regex101.com/r/mPgaq6/1
16
+ const methodInvocationLineMatcher = /(?:self\.moduleName\s*=\s*@\"([^"]*)\";)|(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;
17
+ // https://regex101.com/r/nHrTa9/1/
18
+ // if the above regex fails, we can use this one as a fallback:
19
+ const fallbackInvocationLineMatcher = /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g;
19
20
  // Add import
20
21
  if (!contents.includes('#import <Firebase/Firebase.h>')) {
21
22
  contents = contents.replace(/#import "AppDelegate.h"/g, `#import "AppDelegate.h"
@@ -58,16 +59,49 @@ function modifyObjcAppDelegate(contents) {
58
59
  }).contents;
59
60
  }
60
61
  }
62
+ function modifySwiftAppDelegate(contents) {
63
+ const methodInvocationBlock = `FirebaseApp.configure()`;
64
+ const methodInvocationLineMatcher = /(?:self\.moduleName\s*=\s*"([^"]*)")/g;
65
+ // Add import
66
+ if (!contents.includes('import FirebaseCore')) {
67
+ contents = contents.replace(/import ReactAppDependencyProvider/g, `import ReactAppDependencyProvider
68
+ import FirebaseCore`);
69
+ }
70
+ // To avoid potential issues with existing changes from older plugin versions
71
+ if (contents.includes(methodInvocationBlock)) {
72
+ return contents;
73
+ }
74
+ if (!methodInvocationLineMatcher.test(contents)) {
75
+ config_plugins_1.WarningAggregator.addWarningIOS('@react-native-firebase/app', 'Unable to determine correct Firebase insertion point in AppDelegate.swift. Skipping Firebase addition.');
76
+ return contents;
77
+ }
78
+ // Add invocation
79
+ return (0, generateCode_1.mergeContents)({
80
+ tag: '@react-native-firebase/app-didFinishLaunchingWithOptions',
81
+ src: contents,
82
+ newSrc: methodInvocationBlock,
83
+ anchor: methodInvocationLineMatcher,
84
+ offset: 0, // new line will be inserted right above matched anchor
85
+ comment: '//',
86
+ }).contents;
87
+ }
61
88
  async function modifyAppDelegateAsync(appDelegateFileInfo) {
62
89
  const { language, path, contents } = appDelegateFileInfo;
63
- if (['objc', 'objcpp'].includes(language)) {
64
- const newContents = modifyObjcAppDelegate(contents);
65
- await fs_1.default.promises.writeFile(path, newContents);
66
- }
67
- else {
68
- // TODO: Support Swift
69
- throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
90
+ let newContents = contents;
91
+ switch (language) {
92
+ case 'objc':
93
+ case 'objcpp': {
94
+ newContents = modifyObjcAppDelegate(contents);
95
+ break;
96
+ }
97
+ case 'swift': {
98
+ newContents = modifySwiftAppDelegate(contents);
99
+ break;
100
+ }
101
+ default:
102
+ throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
70
103
  }
104
+ await fs_1.default.promises.writeFile(path, newContents);
71
105
  }
72
106
  const withFirebaseAppDelegate = config => {
73
107
  return (0, config_plugins_1.withDangerousMod)(config, [
@@ -3,17 +3,17 @@ import { AppDelegateProjectFile } from '@expo/config-plugins/build/ios/Paths';
3
3
  import { mergeContents } from '@expo/config-plugins/build/utils/generateCode';
4
4
  import fs from 'fs';
5
5
 
6
- const methodInvocationBlock = `[FIRApp configure];`;
7
- // https://regex101.com/r/mPgaq6/1
8
- const methodInvocationLineMatcher =
9
- /(?:self\.moduleName\s*=\s*@\"([^"]*)\";)|(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;
6
+ export function modifyObjcAppDelegate(contents: string): string {
7
+ const methodInvocationBlock = `[FIRApp configure];`;
8
+ // https://regex101.com/r/mPgaq6/1
9
+ const methodInvocationLineMatcher =
10
+ /(?:self\.moduleName\s*=\s*@\"([^"]*)\";)|(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[(\[RCTBridge alloc\]|self\.reactDelegate))/g;
10
11
 
11
- // https://regex101.com/r/nHrTa9/1/
12
- // if the above regex fails, we can use this one as a fallback:
13
- const fallbackInvocationLineMatcher =
14
- /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g;
12
+ // https://regex101.com/r/nHrTa9/1/
13
+ // if the above regex fails, we can use this one as a fallback:
14
+ const fallbackInvocationLineMatcher =
15
+ /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g;
15
16
 
16
- export function modifyObjcAppDelegate(contents: string): string {
17
17
  // Add import
18
18
  if (!contents.includes('#import <Firebase/Firebase.h>')) {
19
19
  contents = contents.replace(
@@ -68,16 +68,63 @@ export function modifyObjcAppDelegate(contents: string): string {
68
68
  }
69
69
  }
70
70
 
71
+ export function modifySwiftAppDelegate(contents: string): string {
72
+ const methodInvocationBlock = `FirebaseApp.configure()`;
73
+ const methodInvocationLineMatcher = /(?:self\.moduleName\s*=\s*"([^"]*)")/g;
74
+
75
+ // Add import
76
+ if (!contents.includes('import FirebaseCore')) {
77
+ contents = contents.replace(
78
+ /import ReactAppDependencyProvider/g,
79
+ `import ReactAppDependencyProvider
80
+ import FirebaseCore`,
81
+ );
82
+ }
83
+
84
+ // To avoid potential issues with existing changes from older plugin versions
85
+ if (contents.includes(methodInvocationBlock)) {
86
+ return contents;
87
+ }
88
+
89
+ if (!methodInvocationLineMatcher.test(contents)) {
90
+ WarningAggregator.addWarningIOS(
91
+ '@react-native-firebase/app',
92
+ 'Unable to determine correct Firebase insertion point in AppDelegate.swift. Skipping Firebase addition.',
93
+ );
94
+ return contents;
95
+ }
96
+
97
+ // Add invocation
98
+ return mergeContents({
99
+ tag: '@react-native-firebase/app-didFinishLaunchingWithOptions',
100
+ src: contents,
101
+ newSrc: methodInvocationBlock,
102
+ anchor: methodInvocationLineMatcher,
103
+ offset: 0, // new line will be inserted right above matched anchor
104
+ comment: '//',
105
+ }).contents;
106
+ }
107
+
71
108
  export async function modifyAppDelegateAsync(appDelegateFileInfo: AppDelegateProjectFile) {
72
109
  const { language, path, contents } = appDelegateFileInfo;
73
110
 
74
- if (['objc', 'objcpp'].includes(language)) {
75
- const newContents = modifyObjcAppDelegate(contents);
76
- await fs.promises.writeFile(path, newContents);
77
- } else {
78
- // TODO: Support Swift
79
- throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
111
+ let newContents = contents;
112
+
113
+ switch (language) {
114
+ case 'objc':
115
+ case 'objcpp': {
116
+ newContents = modifyObjcAppDelegate(contents);
117
+ break;
118
+ }
119
+ case 'swift': {
120
+ newContents = modifySwiftAppDelegate(contents);
121
+ break;
122
+ }
123
+ default:
124
+ throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
80
125
  }
126
+
127
+ await fs.promises.writeFile(path, newContents);
81
128
  }
82
129
 
83
130
  export const withFirebaseAppDelegate: ConfigPlugin = config => {
@@ -1 +1 @@
1
- {"root":["./src/index.ts","./src/android/applyPlugin.ts","./src/android/buildscriptDependency.ts","./src/android/constants.ts","./src/android/copyGoogleServices.ts","./src/android/index.ts","./src/ios/appDelegate.ts","./src/ios/googleServicesPlist.ts","./src/ios/index.ts"],"version":"5.7.3"}
1
+ {"root":["./src/index.ts","./src/android/applyplugin.ts","./src/android/buildscriptdependency.ts","./src/android/constants.ts","./src/android/copygoogleservices.ts","./src/android/index.ts","./src/ios/appdelegate.ts","./src/ios/googleservicesplist.ts","./src/ios/index.ts"],"version":"5.7.3"}