@react-native-firebase/app 23.8.0 → 23.8.2

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.
Files changed (101) hide show
  1. package/CHANGELOG.md +1547 -0
  2. package/RNFBApp.podspec +49 -0
  3. package/android/.editorconfig +10 -0
  4. package/android/build.gradle +129 -0
  5. package/android/firebase-json.gradle +73 -0
  6. package/android/gradle.properties +2 -0
  7. package/android/lint.xml +5 -0
  8. package/android/settings.gradle +1 -0
  9. package/android/src/main/AndroidManifest.xml +24 -0
  10. package/android/src/main/java/io/invertase/firebase/app/.gitkeep +0 -0
  11. package/android/src/main/java/io/invertase/firebase/common/TaskExecutorService.java +124 -0
  12. package/android/src/main/java/io/invertase/firebase/common/UniversalFirebaseModule.java +62 -0
  13. package/android/src/main/java/io/invertase/firebase/common/UniversalFirebasePreferences.java +91 -0
  14. package/android/src/main/java/io/invertase/firebase/interfaces/.gitkeep +0 -0
  15. package/android/src/reactnative/AndroidManifest.xml +2 -0
  16. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseApp.java +46 -0
  17. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppInitProvider.java +22 -0
  18. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppModule.java +186 -0
  19. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppPackage.java +49 -0
  20. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppRegistrar.java +35 -0
  21. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseVersion.java +22 -0
  22. package/android/src/reactnative/java/io/invertase/firebase/common/RCTConvertFirebase.java +191 -0
  23. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEvent.java +53 -0
  24. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java +151 -0
  25. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseInitProvider.java +78 -0
  26. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseJSON.java +107 -0
  27. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseMeta.java +93 -0
  28. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java +146 -0
  29. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebasePreferences.java +88 -0
  30. package/android/src/reactnative/java/io/invertase/firebase/common/SharedUtils.java +440 -0
  31. package/android/src/reactnative/java/io/invertase/firebase/interfaces/ContextProvider.java +30 -0
  32. package/android/src/reactnative/java/io/invertase/firebase/interfaces/NativeError.java +32 -0
  33. package/android/src/reactnative/java/io/invertase/firebase/interfaces/NativeEvent.java +28 -0
  34. package/android/src/reactnative/java/io/invertase/firebase/utils/ReactNativeFirebaseUtilsModule.java +191 -0
  35. package/app.plugin.js +1 -0
  36. package/dist/commonjs/version.js +1 -1
  37. package/dist/module/version.js +1 -1
  38. package/dist/typescript/commonjs/lib/modular.d.ts +1 -1
  39. package/dist/typescript/commonjs/lib/version.d.ts +1 -1
  40. package/dist/typescript/module/lib/modular.d.ts +1 -1
  41. package/dist/typescript/module/lib/version.d.ts +1 -1
  42. package/firebase-schema.json +149 -0
  43. package/firebase_json.rb +72 -0
  44. package/ios/RNFBApp/RCTConvert+FIRApp.h +23 -0
  45. package/ios/RNFBApp/RCTConvert+FIRApp.m +31 -0
  46. package/ios/RNFBApp/RCTConvert+FIROptions.h +23 -0
  47. package/ios/RNFBApp/RCTConvert+FIROptions.m +36 -0
  48. package/ios/RNFBApp/RNFBAppModule.h +28 -0
  49. package/ios/RNFBApp/RNFBAppModule.m +305 -0
  50. package/ios/RNFBApp/RNFBJSON.h +36 -0
  51. package/ios/RNFBApp/RNFBJSON.m +99 -0
  52. package/ios/RNFBApp/RNFBMeta.h +30 -0
  53. package/ios/RNFBApp/RNFBMeta.m +61 -0
  54. package/ios/RNFBApp/RNFBNullSentinelInterceptor.h +47 -0
  55. package/ios/RNFBApp/RNFBNullSentinelInterceptor.m +74 -0
  56. package/ios/RNFBApp/RNFBPreferences.h +44 -0
  57. package/ios/RNFBApp/RNFBPreferences.m +94 -0
  58. package/ios/RNFBApp/RNFBRCTEventEmitter.h +73 -0
  59. package/ios/RNFBApp/RNFBRCTEventEmitter.m +151 -0
  60. package/ios/RNFBApp/RNFBSharedUtils.h +67 -0
  61. package/ios/RNFBApp/RNFBSharedUtils.m +285 -0
  62. package/ios/RNFBApp/RNFBUtilsModule.h +30 -0
  63. package/ios/RNFBApp/RNFBUtilsModule.m +100 -0
  64. package/ios/RNFBApp/RNFBVersion.h +20 -0
  65. package/ios/RNFBApp/RNFBVersion.m +21 -0
  66. package/ios/RNFBApp.xcodeproj/project.pbxproj +411 -0
  67. package/ios/RNFBApp.xcodeproj/xcshareddata/IDETemplateMacros.plist +24 -0
  68. package/ios_config.sh +269 -0
  69. package/lib/version.ts +1 -1
  70. package/package.json +4 -11
  71. package/plugin/build/android/applyPlugin.d.ts +6 -0
  72. package/plugin/build/android/applyPlugin.js +29 -0
  73. package/plugin/build/android/buildscriptDependency.d.ts +6 -0
  74. package/plugin/build/android/buildscriptDependency.js +31 -0
  75. package/plugin/build/android/constants.d.ts +4 -0
  76. package/plugin/build/android/constants.js +8 -0
  77. package/plugin/build/android/copyGoogleServices.d.ts +5 -0
  78. package/plugin/build/android/copyGoogleServices.js +33 -0
  79. package/plugin/build/android/index.d.ts +4 -0
  80. package/plugin/build/android/index.js +9 -0
  81. package/plugin/build/index.d.ts +3 -0
  82. package/plugin/build/index.js +21 -0
  83. package/plugin/build/ios/appDelegate.d.ts +6 -0
  84. package/plugin/build/ios/appDelegate.js +116 -0
  85. package/plugin/build/ios/googleServicesPlist.d.ts +7 -0
  86. package/plugin/build/ios/googleServicesPlist.js +42 -0
  87. package/plugin/build/ios/index.d.ts +3 -0
  88. package/plugin/build/ios/index.js +7 -0
  89. package/plugin/src/android/applyPlugin.ts +30 -0
  90. package/plugin/src/android/buildscriptDependency.ts +33 -0
  91. package/plugin/src/android/constants.ts +7 -0
  92. package/plugin/src/android/copyGoogleServices.ts +36 -0
  93. package/plugin/src/android/index.ts +5 -0
  94. package/plugin/src/index.ts +27 -0
  95. package/plugin/src/ios/appDelegate.ts +140 -0
  96. package/plugin/src/ios/googleServicesPlist.ts +55 -0
  97. package/plugin/src/ios/index.ts +4 -0
  98. package/plugin/tsconfig.json +9 -0
  99. package/plugin/tsconfig.tsbuildinfo +1 -0
  100. package/react-native.config.js +19 -0
  101. package/tsconfig.json +10 -0
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.withIosGoogleServicesFile = void 0;
7
+ exports.setGoogleServicesFile = setGoogleServicesFile;
8
+ const config_plugins_1 = require("@expo/config-plugins");
9
+ const fs_1 = __importDefault(require("fs"));
10
+ const path_1 = __importDefault(require("path"));
11
+ const withIosGoogleServicesFile = config => {
12
+ return (0, config_plugins_1.withXcodeProject)(config, config => {
13
+ if (!config.ios?.googleServicesFile) {
14
+ throw new Error('Path to GoogleService-Info.plist is not defined. Please specify the `expo.ios.googleServicesFile` field in app.json.');
15
+ }
16
+ config.modResults = setGoogleServicesFile({
17
+ projectRoot: config.modRequest.projectRoot,
18
+ project: config.modResults,
19
+ googleServicesFileRelativePath: config.ios.googleServicesFile,
20
+ });
21
+ return config;
22
+ });
23
+ };
24
+ exports.withIosGoogleServicesFile = withIosGoogleServicesFile;
25
+ function setGoogleServicesFile({ projectRoot, project, googleServicesFileRelativePath, }) {
26
+ const googleServiceFilePath = path_1.default.resolve(projectRoot, googleServicesFileRelativePath);
27
+ if (!fs_1.default.existsSync(googleServiceFilePath)) {
28
+ throw new Error(`GoogleService-Info.plist doesn't exist in ${googleServiceFilePath}. Place it there or configure the path in app.json`);
29
+ }
30
+ fs_1.default.copyFileSync(googleServiceFilePath, path_1.default.join(config_plugins_1.IOSConfig.Paths.getSourceRoot(projectRoot), 'GoogleService-Info.plist'));
31
+ const projectName = config_plugins_1.IOSConfig.XcodeUtils.getProjectName(projectRoot);
32
+ const plistFilePath = `${projectName}/GoogleService-Info.plist`;
33
+ if (!project.hasFile(plistFilePath)) {
34
+ project = config_plugins_1.IOSConfig.XcodeUtils.addResourceFileToGroup({
35
+ filepath: plistFilePath,
36
+ groupName: projectName,
37
+ project,
38
+ isBuildFile: true,
39
+ });
40
+ }
41
+ return project;
42
+ }
@@ -0,0 +1,3 @@
1
+ import { withFirebaseAppDelegate } from './appDelegate';
2
+ import { withIosGoogleServicesFile } from './googleServicesPlist';
3
+ export { withIosGoogleServicesFile, withFirebaseAppDelegate };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withFirebaseAppDelegate = exports.withIosGoogleServicesFile = void 0;
4
+ const appDelegate_1 = require("./appDelegate");
5
+ Object.defineProperty(exports, "withFirebaseAppDelegate", { enumerable: true, get: function () { return appDelegate_1.withFirebaseAppDelegate; } });
6
+ const googleServicesPlist_1 = require("./googleServicesPlist");
7
+ Object.defineProperty(exports, "withIosGoogleServicesFile", { enumerable: true, get: function () { return googleServicesPlist_1.withIosGoogleServicesFile; } });
@@ -0,0 +1,30 @@
1
+ import { ConfigPlugin, WarningAggregator, withAppBuildGradle } from '@expo/config-plugins';
2
+
3
+ import { googleServicesPlugin } from './constants';
4
+
5
+ /**
6
+ * Update `app/build.gradle` by applying google-services plugin
7
+ */
8
+ export const withApplyGoogleServicesPlugin: ConfigPlugin = config => {
9
+ return withAppBuildGradle(config, config => {
10
+ if (config.modResults.language === 'groovy') {
11
+ config.modResults.contents = applyPlugin(config.modResults.contents);
12
+ } else {
13
+ WarningAggregator.addWarningAndroid(
14
+ 'react-native-firebase-app',
15
+ `Cannot automatically configure app build.gradle if it's not groovy`,
16
+ );
17
+ }
18
+ return config;
19
+ });
20
+ };
21
+
22
+ export function applyPlugin(appBuildGradle: string) {
23
+ // Make sure the project does not have the plugin already
24
+ const pattern = new RegExp(`apply\\s+plugin:\\s+['"]${googleServicesPlugin}['"]`);
25
+ if (!appBuildGradle.match(pattern)) {
26
+ return appBuildGradle + `\napply plugin: '${googleServicesPlugin}'`;
27
+ }
28
+
29
+ return appBuildGradle;
30
+ }
@@ -0,0 +1,33 @@
1
+ import { ConfigPlugin, WarningAggregator, withProjectBuildGradle } from '@expo/config-plugins';
2
+
3
+ import { googleServicesClassPath, googleServicesVersion } from './constants';
4
+
5
+ /**
6
+ * Update `<project>/build.gradle` by adding google-services dependency to buildscript
7
+ */
8
+ export const withBuildscriptDependency: ConfigPlugin = config => {
9
+ return withProjectBuildGradle(config, config => {
10
+ if (config.modResults.language === 'groovy') {
11
+ config.modResults.contents = setBuildscriptDependency(config.modResults.contents);
12
+ } else {
13
+ WarningAggregator.addWarningAndroid(
14
+ 'react-native-firebase-app',
15
+ `Cannot automatically configure project build.gradle if it's not groovy`,
16
+ );
17
+ }
18
+ return config;
19
+ });
20
+ };
21
+
22
+ export function setBuildscriptDependency(buildGradle: string) {
23
+ if (!buildGradle.includes(googleServicesClassPath)) {
24
+ // TODO: Find a more stable solution for this
25
+ return buildGradle.replace(
26
+ /dependencies\s?{/,
27
+ `dependencies {
28
+ classpath '${googleServicesClassPath}:${googleServicesVersion}'`,
29
+ );
30
+ } else {
31
+ return buildGradle;
32
+ }
33
+ }
@@ -0,0 +1,7 @@
1
+ const appPackageJson = require('@react-native-firebase/app/package.json');
2
+
3
+ export const DEFAULT_TARGET_PATH = 'app/google-services.json';
4
+
5
+ export const googleServicesClassPath = 'com.google.gms:google-services';
6
+ export const googleServicesPlugin = 'com.google.gms.google-services';
7
+ export const googleServicesVersion = appPackageJson.sdkVersions.android.gmsGoogleServicesGradle;
@@ -0,0 +1,36 @@
1
+ import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins';
2
+
3
+ import { DEFAULT_TARGET_PATH } from './constants';
4
+ import path from 'path';
5
+ import fs from 'fs';
6
+
7
+ /**
8
+ * Copy `google-services.json`
9
+ */
10
+ export const withCopyAndroidGoogleServices: ConfigPlugin = config => {
11
+ return withDangerousMod(config, [
12
+ 'android',
13
+ async config => {
14
+ if (!config.android?.googleServicesFile) {
15
+ throw new Error(
16
+ 'Path to google-services.json is not defined. Please specify the `expo.android.googleServicesFile` field in app.json.',
17
+ );
18
+ }
19
+
20
+ const srcPath = path.resolve(
21
+ config.modRequest.projectRoot,
22
+ config.android.googleServicesFile,
23
+ );
24
+ const destPath = path.resolve(config.modRequest.platformProjectRoot, DEFAULT_TARGET_PATH);
25
+
26
+ try {
27
+ await fs.promises.copyFile(srcPath, destPath);
28
+ } catch (_) {
29
+ throw new Error(
30
+ `Cannot copy google-services.json, because the file ${srcPath} doesn't exist. Please provide a valid path in \`app.json\`.`,
31
+ );
32
+ }
33
+ return config;
34
+ },
35
+ ]);
36
+ };
@@ -0,0 +1,5 @@
1
+ import { withApplyGoogleServicesPlugin } from './applyPlugin';
2
+ import { withBuildscriptDependency } from './buildscriptDependency';
3
+ import { withCopyAndroidGoogleServices } from './copyGoogleServices';
4
+
5
+ export { withBuildscriptDependency, withApplyGoogleServicesPlugin, withCopyAndroidGoogleServices };
@@ -0,0 +1,27 @@
1
+ import { ConfigPlugin, withPlugins, createRunOncePlugin } from '@expo/config-plugins';
2
+
3
+ import {
4
+ withApplyGoogleServicesPlugin,
5
+ withBuildscriptDependency,
6
+ withCopyAndroidGoogleServices,
7
+ } from './android';
8
+ import { withFirebaseAppDelegate, withIosGoogleServicesFile } from './ios';
9
+
10
+ /**
11
+ * A config plugin for configuring `@react-native-firebase/app`
12
+ */
13
+ const withRnFirebaseApp: ConfigPlugin = config => {
14
+ return withPlugins(config, [
15
+ // iOS
16
+ withFirebaseAppDelegate,
17
+ withIosGoogleServicesFile,
18
+
19
+ // Android
20
+ withBuildscriptDependency,
21
+ withApplyGoogleServicesPlugin,
22
+ withCopyAndroidGoogleServices,
23
+ ]);
24
+ };
25
+
26
+ const pak = require('@react-native-firebase/app/package.json');
27
+ export default createRunOncePlugin(withRnFirebaseApp, pak.name, pak.version);
@@ -0,0 +1,140 @@
1
+ import { ConfigPlugin, IOSConfig, WarningAggregator, withDangerousMod } from '@expo/config-plugins';
2
+ import { AppDelegateProjectFile } from '@expo/config-plugins/build/ios/Paths';
3
+ import { mergeContents } from '@expo/config-plugins/build/utils/generateCode';
4
+ import fs from 'fs';
5
+
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;
11
+
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;
16
+
17
+ // Add import
18
+ if (!contents.includes('#import <Firebase/Firebase.h>')) {
19
+ contents = contents.replace(
20
+ /#import "AppDelegate.h"/g,
21
+ `#import "AppDelegate.h"
22
+ #import <Firebase/Firebase.h>`,
23
+ );
24
+ }
25
+
26
+ // To avoid potential issues with existing changes from older plugin versions
27
+ if (contents.includes(methodInvocationBlock)) {
28
+ return contents;
29
+ }
30
+
31
+ if (
32
+ !methodInvocationLineMatcher.test(contents) &&
33
+ !fallbackInvocationLineMatcher.test(contents)
34
+ ) {
35
+ WarningAggregator.addWarningIOS(
36
+ '@react-native-firebase/app',
37
+ 'Unable to determine correct Firebase insertion point in AppDelegate.m. Skipping Firebase addition.',
38
+ );
39
+ return contents;
40
+ }
41
+
42
+ // Add invocation
43
+ try {
44
+ return mergeContents({
45
+ tag: '@react-native-firebase/app-didFinishLaunchingWithOptions',
46
+ src: contents,
47
+ newSrc: methodInvocationBlock,
48
+ anchor: methodInvocationLineMatcher,
49
+ offset: 0, // new line will be inserted right above matched anchor
50
+ comment: '//',
51
+ }).contents;
52
+ } catch (_: any) {
53
+ // tests if the opening `{` is in the new line
54
+ const multilineMatcher = new RegExp(fallbackInvocationLineMatcher.source + '.+\\n*{');
55
+ const isHeaderMultiline = multilineMatcher.test(contents);
56
+
57
+ // we fallback to another regex if the first one fails
58
+ return mergeContents({
59
+ tag: '@react-native-firebase/app-didFinishLaunchingWithOptions-fallback',
60
+ src: contents,
61
+ newSrc: methodInvocationBlock,
62
+ anchor: fallbackInvocationLineMatcher,
63
+ // new line will be inserted right below matched anchor
64
+ // or two lines, if the `{` is in the new line
65
+ offset: isHeaderMultiline ? 2 : 1,
66
+ comment: '//',
67
+ }).contents;
68
+ }
69
+ }
70
+
71
+ export function modifySwiftAppDelegate(contents: string): string {
72
+ const methodInvocationBlock = `FirebaseApp.configure()`;
73
+ const methodInvocationLineMatcher =
74
+ /(?:self\.moduleName\s*=\s*"([^"]*)")|(?:factory\.startReactNative\()/;
75
+
76
+ // Add import
77
+ if (!contents.includes('import FirebaseCore')) {
78
+ contents = contents.replace(
79
+ /import Expo/g,
80
+ `import Expo
81
+ import FirebaseCore`,
82
+ );
83
+ }
84
+
85
+ // To avoid potential issues with existing changes from older plugin versions
86
+ if (contents.includes(methodInvocationBlock)) {
87
+ return contents;
88
+ }
89
+
90
+ if (!methodInvocationLineMatcher.test(contents)) {
91
+ WarningAggregator.addWarningIOS(
92
+ '@react-native-firebase/app',
93
+ 'Unable to determine correct Firebase insertion point in AppDelegate.swift. Skipping Firebase addition.',
94
+ );
95
+ return contents;
96
+ }
97
+
98
+ // Add invocation
99
+ return mergeContents({
100
+ tag: '@react-native-firebase/app-didFinishLaunchingWithOptions',
101
+ src: contents,
102
+ newSrc: methodInvocationBlock,
103
+ anchor: methodInvocationLineMatcher,
104
+ offset: 0, // new line will be inserted right above matched anchor
105
+ comment: '//',
106
+ }).contents;
107
+ }
108
+
109
+ export async function modifyAppDelegateAsync(appDelegateFileInfo: AppDelegateProjectFile) {
110
+ const { language, path, contents } = appDelegateFileInfo;
111
+
112
+ let newContents = contents;
113
+
114
+ switch (language) {
115
+ case 'objc':
116
+ case 'objcpp': {
117
+ newContents = modifyObjcAppDelegate(contents);
118
+ break;
119
+ }
120
+ case 'swift': {
121
+ newContents = modifySwiftAppDelegate(contents);
122
+ break;
123
+ }
124
+ default:
125
+ throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
126
+ }
127
+
128
+ await fs.promises.writeFile(path, newContents);
129
+ }
130
+
131
+ export const withFirebaseAppDelegate: ConfigPlugin = config => {
132
+ return withDangerousMod(config, [
133
+ 'ios',
134
+ async config => {
135
+ const fileInfo = IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
136
+ await modifyAppDelegateAsync(fileInfo);
137
+ return config;
138
+ },
139
+ ]);
140
+ };
@@ -0,0 +1,55 @@
1
+ import { ConfigPlugin, IOSConfig, withXcodeProject, XcodeProject } from '@expo/config-plugins';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+
5
+ export const withIosGoogleServicesFile: ConfigPlugin = config => {
6
+ return withXcodeProject(config, config => {
7
+ if (!config.ios?.googleServicesFile) {
8
+ throw new Error(
9
+ 'Path to GoogleService-Info.plist is not defined. Please specify the `expo.ios.googleServicesFile` field in app.json.',
10
+ );
11
+ }
12
+
13
+ config.modResults = setGoogleServicesFile({
14
+ projectRoot: config.modRequest.projectRoot,
15
+ project: config.modResults,
16
+ googleServicesFileRelativePath: config.ios.googleServicesFile,
17
+ });
18
+ return config;
19
+ });
20
+ };
21
+
22
+ export function setGoogleServicesFile({
23
+ projectRoot,
24
+ project,
25
+ googleServicesFileRelativePath,
26
+ }: {
27
+ project: XcodeProject;
28
+ projectRoot: string;
29
+ googleServicesFileRelativePath: string;
30
+ }): XcodeProject {
31
+ const googleServiceFilePath = path.resolve(projectRoot, googleServicesFileRelativePath);
32
+
33
+ if (!fs.existsSync(googleServiceFilePath)) {
34
+ throw new Error(
35
+ `GoogleService-Info.plist doesn't exist in ${googleServiceFilePath}. Place it there or configure the path in app.json`,
36
+ );
37
+ }
38
+
39
+ fs.copyFileSync(
40
+ googleServiceFilePath,
41
+ path.join(IOSConfig.Paths.getSourceRoot(projectRoot), 'GoogleService-Info.plist'),
42
+ );
43
+
44
+ const projectName = IOSConfig.XcodeUtils.getProjectName(projectRoot);
45
+ const plistFilePath = `${projectName}/GoogleService-Info.plist`;
46
+ if (!project.hasFile(plistFilePath)) {
47
+ project = IOSConfig.XcodeUtils.addResourceFileToGroup({
48
+ filepath: plistFilePath,
49
+ groupName: projectName,
50
+ project,
51
+ isBuildFile: true,
52
+ });
53
+ }
54
+ return project;
55
+ }
@@ -0,0 +1,4 @@
1
+ import { withFirebaseAppDelegate } from './appDelegate';
2
+ import { withIosGoogleServicesFile } from './googleServicesPlist';
3
+
4
+ export { withIosGoogleServicesFile, withFirebaseAppDelegate };
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "@tsconfig/node-lts/tsconfig",
3
+ "compilerOptions": {
4
+ "outDir": "build",
5
+ "rootDir": "src",
6
+ "declaration": true
7
+ },
8
+ "include": ["./src"]
9
+ }
@@ -0,0 +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.9.3"}
@@ -0,0 +1,19 @@
1
+ module.exports = {
2
+ dependency: {
3
+ platforms: {
4
+ android: {
5
+ packageImportPath: 'import io.invertase.firebase.app.ReactNativeFirebaseAppPackage;',
6
+ },
7
+ ios: {
8
+ scriptPhases: [
9
+ {
10
+ name: '[RNFB] Core Configuration',
11
+ path: './ios_config.sh',
12
+ execution_position: 'after_compile',
13
+ input_files: ['$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)'],
14
+ },
15
+ ],
16
+ },
17
+ },
18
+ },
19
+ };
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "../../tsconfig.packages.base.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "rootDir": ".",
6
+ "lib": ["ESNext", "DOM"]
7
+ },
8
+ "include": ["lib/**/*"],
9
+ "exclude": ["node_modules", "dist", "__tests__", "**/*.test.ts"]
10
+ }