@react-native-firebase/app 26.1.0 → 26.3.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +14 -0
  3. package/RNFBApp.podspec +5 -1
  4. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseVersion.java +1 -1
  5. package/android/src/reactnative/java/io/invertase/firebase/app/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboUtilsSpec.java +2 -1
  6. package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/CMakeLists.txt +1 -9
  7. package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/react/renderer/components/RNFBAppTurboModules/RNFBAppTurboModulesJSI.h +205 -292
  8. package/android/src/reactnative/java/io/invertase/firebase/utils/NativeRNFBTurboUtils.java +15 -0
  9. package/android/src/test/java/io/invertase/firebase/utils/NativeRNFBTurboUtilsTest.java +120 -0
  10. package/dist/module/types/app.js.map +1 -1
  11. package/dist/module/utils/index.js +13 -1
  12. package/dist/module/utils/index.js.map +1 -1
  13. package/dist/module/version.js +1 -1
  14. package/dist/typescript/lib/internal/NativeModules.d.ts +2 -0
  15. package/dist/typescript/lib/internal/NativeModules.d.ts.map +1 -1
  16. package/dist/typescript/lib/types/app.d.ts +5 -0
  17. package/dist/typescript/lib/types/app.d.ts.map +1 -1
  18. package/dist/typescript/lib/utils/index.d.ts.map +1 -1
  19. package/dist/typescript/lib/version.d.ts +1 -1
  20. package/firebase_json.rb +11 -10
  21. package/firebase_spm.rb +186 -110
  22. package/ios/RNFBApp/RNFBUtilsModule.mm +10 -2
  23. package/ios/RNFBApp/RNFBVersion.m +1 -1
  24. package/ios/generated/RNFBAppTurboModules/RNFBAppTurboModules.h +7 -4
  25. package/ios/generated/RNFBAppTurboModulesJSI.h +205 -292
  26. package/lib/internal/NativeModules.ts +2 -0
  27. package/lib/types/app.ts +5 -0
  28. package/lib/utils/index.ts +13 -1
  29. package/lib/version.ts +1 -1
  30. package/package.json +8 -9
  31. package/plugin/build/index.d.ts +2 -1
  32. package/plugin/build/index.js +2 -1
  33. package/plugin/build/ios/index.d.ts +2 -1
  34. package/plugin/build/ios/index.js +3 -1
  35. package/plugin/build/ios/podfile.d.ts +4 -0
  36. package/plugin/build/ios/podfile.js +32 -0
  37. package/plugin/build/pluginConfig.d.ts +12 -0
  38. package/plugin/build/pluginConfig.js +2 -0
  39. package/plugin/src/index.ts +4 -2
  40. package/plugin/src/ios/index.ts +2 -1
  41. package/plugin/src/ios/podfile.ts +40 -0
  42. package/plugin/src/pluginConfig.ts +13 -0
  43. package/plugin/tsconfig.tsbuildinfo +1 -1
  44. package/specs/NativeRNFBTurboUtils.ts +2 -0
  45. package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/react/renderer/components/RNFBAppTurboModules/RNFBAppTurboModulesJSI-generated.cpp +0 -187
  46. package/ios/generated/RCTAppDependencyProvider.h +0 -25
  47. package/ios/generated/RCTAppDependencyProvider.mm +0 -55
  48. package/ios/generated/RCTModuleProviders.h +0 -16
  49. package/ios/generated/RCTModuleProviders.mm +0 -52
  50. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +0 -18
  51. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +0 -33
  52. package/ios/generated/RCTThirdPartyComponentsProvider.h +0 -16
  53. package/ios/generated/RCTThirdPartyComponentsProvider.mm +0 -23
  54. package/ios/generated/RCTUnstableModulesRequiringMainQueueSetupProvider.h +0 -14
  55. package/ios/generated/RCTUnstableModulesRequiringMainQueueSetupProvider.mm +0 -19
  56. package/ios/generated/RNFBAppTurboModulesJSI-generated.cpp +0 -187
  57. package/ios/generated/ReactAppDependencyProvider.podspec +0 -34
  58. package/ios/generated/ReactCodegen.podspec +0 -111
@@ -75,6 +75,8 @@ export interface RNFBAppModuleInterface {
75
75
  export interface RNFBUtilsModuleInterface {
76
76
  // Android-only properties and methods
77
77
  isRunningInTestLab: boolean;
78
+ /** Host app marketing version when available from native utils constants. */
79
+ appVersion?: string;
78
80
  androidPlayServices: {
79
81
  isAvailable: boolean;
80
82
  status: number;
package/lib/types/app.ts CHANGED
@@ -556,6 +556,11 @@ export namespace Utils {
556
556
  * ```
557
557
  */
558
558
  abstract isRunningInTestLab: boolean;
559
+ /**
560
+ * Host app marketing version string when available from native
561
+ * (Android `versionName` / iOS `CFBundleShortVersionString`), otherwise `undefined`.
562
+ */
563
+ abstract appVersion: string | undefined;
559
564
  /**
560
565
  * Returns PlayServicesAvailability properties, always `{ isAvailable: true, status: 0 }` on iOS
561
566
  *
@@ -15,7 +15,7 @@
15
15
  *
16
16
  */
17
17
 
18
- import { isIOS } from '../common';
18
+ import { isIOS, isOther } from '../common';
19
19
  import { FirebaseModule, getOrCreateModularInstance } from '../internal';
20
20
  import type { ModuleConfig } from '../internal';
21
21
  import type { ReactNativeFirebase, Utils } from '../types/app';
@@ -41,6 +41,18 @@ class FirebaseUtilsModule extends FirebaseModule<'RNFBUtilsModule'> {
41
41
  return this.native.isRunningInTestLab;
42
42
  }
43
43
 
44
+ /**
45
+ * Host app marketing version (Android `versionName` / iOS `CFBundleShortVersionString`).
46
+ * Empty or unavailable on web / non-native platforms.
47
+ */
48
+ get appVersion(): string | undefined {
49
+ if (isOther) {
50
+ return undefined;
51
+ }
52
+ const version = this.native.appVersion;
53
+ return typeof version === 'string' && version.length > 0 ? version : undefined;
54
+ }
55
+
44
56
  get playServicesAvailability(): Utils.PlayServicesAvailability {
45
57
  if (isIOS) {
46
58
  return {
package/lib/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '26.1.0';
2
+ export const version = '26.3.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/app",
3
- "version": "26.1.0",
3
+ "version": "26.3.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": "./dist/module/index.js",
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "scripts": {
24
24
  "codegen": "yarn android:codegen && yarn ios:codegen",
25
- "android:codegen": "npx @react-native-community/cli codegen --platform android --outputPath=./android/src/reactnative/java/io/invertase/firebase/app/generated",
26
- "ios:codegen": "npx @react-native-community/cli codegen --platform ios --outputPath=./ios/generated",
25
+ "android:codegen": "node ../../scripts/codegen-package.mjs app android",
26
+ "ios:codegen": "node ../../scripts/codegen-package.mjs app ios",
27
27
  "build": "genversion --esm --semi lib/version.ts && npm run build:version",
28
28
  "build:version": "node ./scripts/genversion-ios && node ./scripts/genversion-android",
29
29
  "build:clean": "rimraf android/build && rimraf ios/build",
@@ -112,10 +112,9 @@
112
112
  "react-native": "*"
113
113
  },
114
114
  "dependencies": {
115
- "firebase": "12.17.0"
115
+ "firebase": "12.17.1"
116
116
  },
117
117
  "devDependencies": {
118
- "@react-native-async-storage/async-storage": "^2.0.2",
119
118
  "expo": "^55.0.18",
120
119
  "react-native-builder-bob": "^0.41.0"
121
120
  },
@@ -130,7 +129,7 @@
130
129
  },
131
130
  "sdkVersions": {
132
131
  "ios": {
133
- "firebase": "12.17.0",
132
+ "firebase": "12.18.0",
134
133
  "firebaseSpmUrl": "https://github.com/firebase/firebase-ios-sdk.git",
135
134
  "iosTarget": "15.0",
136
135
  "macosTarget": "10.15",
@@ -140,8 +139,8 @@
140
139
  "minSdk": 23,
141
140
  "targetSdk": 34,
142
141
  "compileSdk": 34,
143
- "firebase": "34.16.0",
144
- "firebaseCrashlyticsGradle": "3.0.7",
142
+ "firebase": "34.18.0",
143
+ "firebaseCrashlyticsGradle": "3.0.8",
145
144
  "firebasePerfGradle": "2.0.2",
146
145
  "gmsGoogleServicesGradle": "4.5.0",
147
146
  "playServicesAuth": "21.5.0",
@@ -184,5 +183,5 @@
184
183
  }
185
184
  }
186
185
  },
187
- "gitHead": "59d053eca14ab8aa80e5ac76887014925c67e52b"
186
+ "gitHead": "12a52d40c0d156d05a16f4b49eb0e507c0f5d8c5"
188
187
  }
@@ -1,3 +1,4 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
- declare const _default: ConfigPlugin<void>;
2
+ import { PluginConfigType } from './pluginConfig';
3
+ declare const _default: ConfigPlugin<PluginConfigType>;
3
4
  export default _default;
@@ -6,11 +6,12 @@ const ios_1 = require("./ios");
6
6
  /**
7
7
  * A config plugin for configuring `@react-native-firebase/app`
8
8
  */
9
- const withRnFirebaseApp = config => {
9
+ const withRnFirebaseApp = (config, props) => {
10
10
  return (0, config_plugins_1.withPlugins)(config, [
11
11
  // iOS
12
12
  ios_1.withFirebaseAppDelegate,
13
13
  ios_1.withIosGoogleServicesFile,
14
+ [ios_1.withIosDisableSPM, props],
14
15
  // Android
15
16
  android_1.withBuildscriptDependency,
16
17
  android_1.withApplyGoogleServicesPlugin,
@@ -1,3 +1,4 @@
1
1
  import { withFirebaseAppDelegate } from './appDelegate';
2
2
  import { withIosGoogleServicesFile } from './googleServicesPlist';
3
- export { withIosGoogleServicesFile, withFirebaseAppDelegate };
3
+ import { withIosDisableSPM } from './podfile';
4
+ export { withIosGoogleServicesFile, withFirebaseAppDelegate, withIosDisableSPM };
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withFirebaseAppDelegate = exports.withIosGoogleServicesFile = void 0;
3
+ exports.withIosDisableSPM = exports.withFirebaseAppDelegate = exports.withIosGoogleServicesFile = void 0;
4
4
  const appDelegate_1 = require("./appDelegate");
5
5
  Object.defineProperty(exports, "withFirebaseAppDelegate", { enumerable: true, get: function () { return appDelegate_1.withFirebaseAppDelegate; } });
6
6
  const googleServicesPlist_1 = require("./googleServicesPlist");
7
7
  Object.defineProperty(exports, "withIosGoogleServicesFile", { enumerable: true, get: function () { return googleServicesPlist_1.withIosGoogleServicesFile; } });
8
+ const podfile_1 = require("./podfile");
9
+ Object.defineProperty(exports, "withIosDisableSPM", { enumerable: true, get: function () { return podfile_1.withIosDisableSPM; } });
@@ -0,0 +1,4 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ import { PluginConfigType } from '../pluginConfig';
3
+ export declare function setAppPodfileDisableSPM(src: string, enabled?: boolean): string;
4
+ export declare const withIosDisableSPM: ConfigPlugin<PluginConfigType>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withIosDisableSPM = void 0;
4
+ exports.setAppPodfileDisableSPM = setAppPodfileDisableSPM;
5
+ const config_plugins_1 = require("@expo/config-plugins");
6
+ const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
7
+ const TAG = '@react-native-firebase/app-disableSPM';
8
+ const ANCHOR = /prepare_react_native_project!/;
9
+ const FLAG = '$RNFirebaseDisableSPM = true';
10
+ // The flag must be defined before any target block so firebase_spm.rb sees it
11
+ // when pods are declared - anchoring just after `prepare_react_native_project!`
12
+ // guarantees that in the Podfile Expo generates.
13
+ function setAppPodfileDisableSPM(src, enabled = false) {
14
+ if (!enabled) {
15
+ return (0, generateCode_1.removeGeneratedContents)(src, TAG) ?? src;
16
+ }
17
+ return (0, generateCode_1.mergeContents)({
18
+ src,
19
+ newSrc: FLAG,
20
+ tag: TAG,
21
+ anchor: ANCHOR,
22
+ offset: 1,
23
+ comment: '#',
24
+ }).contents;
25
+ }
26
+ const withIosDisableSPM = (config, props) => {
27
+ return (0, config_plugins_1.withPodfile)(config, config => {
28
+ config.modResults.contents = setAppPodfileDisableSPM(config.modResults.contents, props?.ios?.disableSPM === true);
29
+ return config;
30
+ });
31
+ };
32
+ exports.withIosDisableSPM = withIosDisableSPM;
@@ -0,0 +1,12 @@
1
+ export interface PluginConfigType {
2
+ ios?: PluginConfigTypeIos;
3
+ }
4
+ export interface PluginConfigTypeIos {
5
+ /**
6
+ * Sets `$RNFirebaseDisableSPM = true` in the Podfile, forcing Firebase
7
+ * dependencies to be installed with CocoaPods instead of Swift Package Manager.
8
+ *
9
+ * @platform ios iOS
10
+ */
11
+ disableSPM?: boolean;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,16 +5,18 @@ import {
5
5
  withBuildscriptDependency,
6
6
  withCopyAndroidGoogleServices,
7
7
  } from './android';
8
- import { withFirebaseAppDelegate, withIosGoogleServicesFile } from './ios';
8
+ import { withFirebaseAppDelegate, withIosGoogleServicesFile, withIosDisableSPM } from './ios';
9
+ import { PluginConfigType } from './pluginConfig';
9
10
 
10
11
  /**
11
12
  * A config plugin for configuring `@react-native-firebase/app`
12
13
  */
13
- const withRnFirebaseApp: ConfigPlugin = config => {
14
+ const withRnFirebaseApp: ConfigPlugin<PluginConfigType> = (config, props) => {
14
15
  return withPlugins(config, [
15
16
  // iOS
16
17
  withFirebaseAppDelegate,
17
18
  withIosGoogleServicesFile,
19
+ [withIosDisableSPM, props],
18
20
 
19
21
  // Android
20
22
  withBuildscriptDependency,
@@ -1,4 +1,5 @@
1
1
  import { withFirebaseAppDelegate } from './appDelegate';
2
2
  import { withIosGoogleServicesFile } from './googleServicesPlist';
3
+ import { withIosDisableSPM } from './podfile';
3
4
 
4
- export { withIosGoogleServicesFile, withFirebaseAppDelegate };
5
+ export { withIosGoogleServicesFile, withFirebaseAppDelegate, withIosDisableSPM };
@@ -0,0 +1,40 @@
1
+ import { ConfigPlugin, withPodfile } from '@expo/config-plugins';
2
+ import {
3
+ mergeContents,
4
+ removeGeneratedContents,
5
+ } from '@expo/config-plugins/build/utils/generateCode';
6
+
7
+ import { PluginConfigType } from '../pluginConfig';
8
+
9
+ const TAG = '@react-native-firebase/app-disableSPM';
10
+ const ANCHOR = /prepare_react_native_project!/;
11
+ const FLAG = '$RNFirebaseDisableSPM = true';
12
+
13
+ // The flag must be defined before any target block so firebase_spm.rb sees it
14
+ // when pods are declared - anchoring just after `prepare_react_native_project!`
15
+ // guarantees that in the Podfile Expo generates.
16
+ export function setAppPodfileDisableSPM(src: string, enabled: boolean = false): string {
17
+ if (!enabled) {
18
+ return removeGeneratedContents(src, TAG) ?? src;
19
+ }
20
+
21
+ return mergeContents({
22
+ src,
23
+ newSrc: FLAG,
24
+ tag: TAG,
25
+ anchor: ANCHOR,
26
+ offset: 1,
27
+ comment: '#',
28
+ }).contents;
29
+ }
30
+
31
+ export const withIosDisableSPM: ConfigPlugin<PluginConfigType> = (config, props) => {
32
+ return withPodfile(config, config => {
33
+ config.modResults.contents = setAppPodfileDisableSPM(
34
+ config.modResults.contents,
35
+ props?.ios?.disableSPM === true,
36
+ );
37
+
38
+ return config;
39
+ });
40
+ };
@@ -0,0 +1,13 @@
1
+ export interface PluginConfigType {
2
+ ios?: PluginConfigTypeIos;
3
+ }
4
+
5
+ export interface PluginConfigTypeIos {
6
+ /**
7
+ * Sets `$RNFirebaseDisableSPM = true` in the Podfile, forcing Firebase
8
+ * dependencies to be installed with CocoaPods instead of Swift Package Manager.
9
+ *
10
+ * @platform ios iOS
11
+ */
12
+ disableSPM?: boolean;
13
+ }
@@ -1 +1 @@
1
- {"root":["./src/app.plugin.ts","./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":"6.0.3"}
1
+ {"root":["./src/app.plugin.ts","./src/index.ts","./src/pluginConfig.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","./src/ios/podfile.ts"],"version":"6.0.3"}
@@ -12,6 +12,8 @@ export type PlayServicesAvailability = {
12
12
  export interface Spec extends TurboModule {
13
13
  getConstants(): {
14
14
  isRunningInTestLab: boolean;
15
+ /** Host app marketing version (Android versionName / iOS CFBundleShortVersionString). */
16
+ appVersion?: string;
15
17
  MAIN_BUNDLE: string;
16
18
  CACHES_DIRECTORY: string;
17
19
  DOCUMENT_DIRECTORY: string;
@@ -1,187 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleCpp.js
8
- */
9
-
10
- #include "RNFBAppTurboModulesJSI.h"
11
-
12
- namespace facebook::react {
13
-
14
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->getConstants(
16
- rt
17
- );
18
- }
19
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_initializeApp(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
20
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->initializeApp(
21
- rt,
22
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt),
23
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt)
24
- );
25
- }
26
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_setAutomaticDataCollectionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
27
- static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->setAutomaticDataCollectionEnabled(
28
- rt,
29
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
30
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool()
31
- );
32
- return jsi::Value::undefined();
33
- }
34
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_deleteApp(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
35
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->deleteApp(
36
- rt,
37
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
38
- );
39
- }
40
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_eventsNotifyReady(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
41
- static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->eventsNotifyReady(
42
- rt,
43
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
44
- );
45
- return jsi::Value::undefined();
46
- }
47
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_eventsGetListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
48
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->eventsGetListeners(
49
- rt
50
- );
51
- }
52
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_eventsPing(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
53
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->eventsPing(
54
- rt,
55
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
56
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt)
57
- );
58
- }
59
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_eventsAddListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
60
- static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->eventsAddListener(
61
- rt,
62
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
63
- );
64
- return jsi::Value::undefined();
65
- }
66
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_eventsRemoveListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
67
- static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->eventsRemoveListener(
68
- rt,
69
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
70
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool()
71
- );
72
- return jsi::Value::undefined();
73
- }
74
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
75
- static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->addListener(
76
- rt,
77
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
78
- );
79
- return jsi::Value::undefined();
80
- }
81
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
82
- static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->removeListeners(
83
- rt,
84
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber()
85
- );
86
- return jsi::Value::undefined();
87
- }
88
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_metaGetAll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
89
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->metaGetAll(
90
- rt
91
- );
92
- }
93
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_jsonGetAll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
94
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->jsonGetAll(
95
- rt
96
- );
97
- }
98
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_preferencesSetBool(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
99
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->preferencesSetBool(
100
- rt,
101
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
102
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool()
103
- );
104
- }
105
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_preferencesSetString(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
106
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->preferencesSetString(
107
- rt,
108
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
109
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
110
- );
111
- }
112
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_preferencesGetAll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
113
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->preferencesGetAll(
114
- rt
115
- );
116
- }
117
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_preferencesClearAll(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
118
- return static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->preferencesClearAll(
119
- rt
120
- );
121
- }
122
- static jsi::Value __hostFunction_NativeRNFBTurboAppCxxSpecJSI_setLogLevel(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
123
- static_cast<NativeRNFBTurboAppCxxSpecJSI *>(&turboModule)->setLogLevel(
124
- rt,
125
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
126
- );
127
- return jsi::Value::undefined();
128
- }
129
-
130
- NativeRNFBTurboAppCxxSpecJSI::NativeRNFBTurboAppCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
131
- : TurboModule("NativeRNFBTurboApp", jsInvoker) {
132
- methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_getConstants};
133
- methodMap_["initializeApp"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_initializeApp};
134
- methodMap_["setAutomaticDataCollectionEnabled"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_setAutomaticDataCollectionEnabled};
135
- methodMap_["deleteApp"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_deleteApp};
136
- methodMap_["eventsNotifyReady"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_eventsNotifyReady};
137
- methodMap_["eventsGetListeners"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_eventsGetListeners};
138
- methodMap_["eventsPing"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_eventsPing};
139
- methodMap_["eventsAddListener"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_eventsAddListener};
140
- methodMap_["eventsRemoveListener"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_eventsRemoveListener};
141
- methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_addListener};
142
- methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_removeListeners};
143
- methodMap_["metaGetAll"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_metaGetAll};
144
- methodMap_["jsonGetAll"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_jsonGetAll};
145
- methodMap_["preferencesSetBool"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_preferencesSetBool};
146
- methodMap_["preferencesSetString"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_preferencesSetString};
147
- methodMap_["preferencesGetAll"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_preferencesGetAll};
148
- methodMap_["preferencesClearAll"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_preferencesClearAll};
149
- methodMap_["setLogLevel"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboAppCxxSpecJSI_setLogLevel};
150
- }
151
- static jsi::Value __hostFunction_NativeRNFBTurboUtilsCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
152
- return static_cast<NativeRNFBTurboUtilsCxxSpecJSI *>(&turboModule)->getConstants(
153
- rt
154
- );
155
- }
156
- static jsi::Value __hostFunction_NativeRNFBTurboUtilsCxxSpecJSI_androidGetPlayServicesStatus(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
157
- return static_cast<NativeRNFBTurboUtilsCxxSpecJSI *>(&turboModule)->androidGetPlayServicesStatus(
158
- rt
159
- );
160
- }
161
- static jsi::Value __hostFunction_NativeRNFBTurboUtilsCxxSpecJSI_androidPromptForPlayServices(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
162
- return static_cast<NativeRNFBTurboUtilsCxxSpecJSI *>(&turboModule)->androidPromptForPlayServices(
163
- rt
164
- );
165
- }
166
- static jsi::Value __hostFunction_NativeRNFBTurboUtilsCxxSpecJSI_androidResolutionForPlayServices(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
167
- return static_cast<NativeRNFBTurboUtilsCxxSpecJSI *>(&turboModule)->androidResolutionForPlayServices(
168
- rt
169
- );
170
- }
171
- static jsi::Value __hostFunction_NativeRNFBTurboUtilsCxxSpecJSI_androidMakePlayServicesAvailable(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
172
- return static_cast<NativeRNFBTurboUtilsCxxSpecJSI *>(&turboModule)->androidMakePlayServicesAvailable(
173
- rt
174
- );
175
- }
176
-
177
- NativeRNFBTurboUtilsCxxSpecJSI::NativeRNFBTurboUtilsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
178
- : TurboModule("NativeRNFBTurboUtils", jsInvoker) {
179
- methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboUtilsCxxSpecJSI_getConstants};
180
- methodMap_["androidGetPlayServicesStatus"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboUtilsCxxSpecJSI_androidGetPlayServicesStatus};
181
- methodMap_["androidPromptForPlayServices"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboUtilsCxxSpecJSI_androidPromptForPlayServices};
182
- methodMap_["androidResolutionForPlayServices"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboUtilsCxxSpecJSI_androidResolutionForPlayServices};
183
- methodMap_["androidMakePlayServicesAvailable"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboUtilsCxxSpecJSI_androidMakePlayServicesAvailable};
184
- }
185
-
186
-
187
- } // namespace facebook::react
@@ -1,25 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
-
9
- #import <Foundation/Foundation.h>
10
-
11
- #if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
12
- #import <React-RCTAppDelegate/RCTDependencyProvider.h>
13
- #elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
14
- #import <React_RCTAppDelegate/RCTDependencyProvider.h>
15
- #else
16
- #import "RCTDependencyProvider.h"
17
- #endif
18
-
19
- NS_ASSUME_NONNULL_BEGIN
20
-
21
- @interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
22
-
23
- @end
24
-
25
- NS_ASSUME_NONNULL_END
@@ -1,55 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #import "RCTAppDependencyProvider.h"
9
- #import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
10
- #import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
11
-
12
- @implementation RCTAppDependencyProvider {
13
- NSArray<NSString *> * _URLRequestHandlerClassNames;
14
- NSArray<NSString *> * _imageDataDecoderClassNames;
15
- NSArray<NSString *> * _imageURLLoaderClassNames;
16
- NSDictionary<NSString *,Class<RCTComponentViewProtocol>> * _thirdPartyFabricComponents;
17
- }
18
-
19
- - (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
20
- static dispatch_once_t requestUrlToken;
21
- dispatch_once(&requestUrlToken, ^{
22
- self->_URLRequestHandlerClassNames = RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
23
- });
24
-
25
- return _URLRequestHandlerClassNames;
26
- }
27
-
28
- - (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
29
- static dispatch_once_t dataDecoderToken;
30
- dispatch_once(&dataDecoderToken, ^{
31
- _imageDataDecoderClassNames = RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
32
- });
33
-
34
- return _imageDataDecoderClassNames;
35
- }
36
-
37
- - (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
38
- static dispatch_once_t urlLoaderToken;
39
- dispatch_once(&urlLoaderToken, ^{
40
- _imageURLLoaderClassNames = RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
41
- });
42
-
43
- return _imageURLLoaderClassNames;
44
- }
45
-
46
- - (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
47
- static dispatch_once_t nativeComponentsToken;
48
- dispatch_once(&nativeComponentsToken, ^{
49
- _thirdPartyFabricComponents = RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
50
- });
51
-
52
- return _thirdPartyFabricComponents;
53
- }
54
-
55
- @end
@@ -1,16 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #import <Foundation/Foundation.h>
9
-
10
- @protocol RCTModuleProvider;
11
-
12
- @interface RCTModuleProviders: NSObject
13
-
14
- + (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders;
15
-
16
- @end
@@ -1,52 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #import <Foundation/Foundation.h>
9
-
10
- #import "RCTModuleProviders.h"
11
- #import <ReactCommon/RCTTurboModule.h>
12
- #import <React/RCTLog.h>
13
-
14
- @implementation RCTModuleProviders
15
-
16
- + (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders
17
- {
18
- static NSDictionary<NSString *, id<RCTModuleProvider>> *providers = nil;
19
- static dispatch_once_t onceToken;
20
-
21
- dispatch_once(&onceToken, ^{
22
- NSDictionary<NSString *, NSString *> * moduleMapping = @{
23
- @"NativeRNFBTurboApp": @"RNFBAppModule", // @react-native-firebase/app
24
- @"NativeRNFBTurboUtils": @"RNFBUtilsModule", // @react-native-firebase/app
25
- };
26
-
27
- NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:moduleMapping.count];
28
-
29
- for (NSString *key in moduleMapping) {
30
- NSString * moduleProviderName = moduleMapping[key];
31
- Class klass = NSClassFromString(moduleProviderName);
32
- if (!klass) {
33
- RCTLogError(@"Module provider %@ cannot be found in the runtime", moduleProviderName);
34
- continue;
35
- }
36
-
37
- id instance = [klass new];
38
- if (![instance respondsToSelector:@selector(getTurboModule:)]) {
39
- RCTLogError(@"Module provider %@ does not conform to RCTModuleProvider", moduleProviderName);
40
- continue;
41
- }
42
-
43
- [dict setObject:instance forKey:key];
44
- }
45
-
46
- providers = dict;
47
- });
48
-
49
- return providers;
50
- }
51
-
52
- @end