@react-native-firebase/app 25.1.0 → 26.0.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 (150) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/RNFBApp.podspec +7 -13
  3. package/android/build.gradle +25 -6
  4. package/android/src/reactnative/java/io/invertase/firebase/app/{ReactNativeFirebaseAppModule.java → NativeRNFBTurboApp.java} +81 -45
  5. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppPackage.java +3 -3
  6. package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseVersion.java +2 -2
  7. package/android/src/reactnative/java/io/invertase/firebase/app/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboAppSpec.java +136 -0
  8. package/android/src/reactnative/java/io/invertase/firebase/app/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboUtilsSpec.java +94 -0
  9. package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/CMakeLists.txt +36 -0
  10. package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/RNFBAppTurboModules-generated.cpp +170 -0
  11. package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/RNFBAppTurboModules.h +39 -0
  12. package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/react/renderer/components/RNFBAppTurboModules/RNFBAppTurboModulesJSI-generated.cpp +187 -0
  13. package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/react/renderer/components/RNFBAppTurboModules/RNFBAppTurboModulesJSI.h +606 -0
  14. package/android/src/reactnative/java/io/invertase/firebase/common/RCTConvertFirebase.java +3 -3
  15. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java +475 -20
  16. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseMeta.java +8 -0
  17. package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebasePreferences.java +8 -0
  18. package/android/src/reactnative/java/io/invertase/firebase/utils/{ReactNativeFirebaseUtilsModule.java → NativeRNFBTurboUtils.java} +57 -40
  19. package/android/src/test/java/io/invertase/firebase/app/NativeRNFBTurboAppTest.java +400 -0
  20. package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitterTest.java +1823 -0
  21. package/app.plugin.js +1 -1
  22. package/dist/module/FirebaseApp.js +0 -9
  23. package/dist/module/FirebaseApp.js.map +1 -1
  24. package/dist/module/common/index.js +0 -645
  25. package/dist/module/common/index.js.map +1 -1
  26. package/dist/module/common/unitTestUtils.js +18 -54
  27. package/dist/module/common/unitTestUtils.js.map +1 -1
  28. package/dist/module/index.js +0 -1
  29. package/dist/module/index.js.map +1 -1
  30. package/dist/module/internal/RNFBNativeEventEmitter.js +12 -6
  31. package/dist/module/internal/RNFBNativeEventEmitter.js.map +1 -1
  32. package/dist/module/internal/constants.js +2 -2
  33. package/dist/module/internal/constants.js.map +1 -1
  34. package/dist/module/internal/index.js +1 -1
  35. package/dist/module/internal/index.js.map +1 -1
  36. package/dist/module/internal/nativeModuleAndroidIos.js +50 -10
  37. package/dist/module/internal/nativeModuleAndroidIos.js.map +1 -1
  38. package/dist/module/internal/nativeModuleWeb.js +12 -4
  39. package/dist/module/internal/nativeModuleWeb.js.map +1 -1
  40. package/dist/module/internal/registry/app.js +20 -12
  41. package/dist/module/internal/registry/app.js.map +1 -1
  42. package/dist/module/internal/registry/modular.js +73 -0
  43. package/dist/module/internal/registry/modular.js.map +1 -0
  44. package/dist/module/internal/registry/nativeModule.js +116 -95
  45. package/dist/module/internal/registry/nativeModule.js.map +1 -1
  46. package/dist/module/modular.js +44 -37
  47. package/dist/module/modular.js.map +1 -1
  48. package/dist/module/types/app.js +0 -3
  49. package/dist/module/types/app.js.map +1 -1
  50. package/dist/module/types/internal.js +0 -2
  51. package/dist/module/utils/UtilsStatics.js +2 -2
  52. package/dist/module/utils/UtilsStatics.js.map +1 -1
  53. package/dist/module/utils/index.js +21 -17
  54. package/dist/module/utils/index.js.map +1 -1
  55. package/dist/module/version.js +1 -1
  56. package/dist/typescript/lib/FirebaseApp.d.ts +1 -2
  57. package/dist/typescript/lib/FirebaseApp.d.ts.map +1 -1
  58. package/dist/typescript/lib/common/index.d.ts +0 -8
  59. package/dist/typescript/lib/common/index.d.ts.map +1 -1
  60. package/dist/typescript/lib/common/unitTestUtils.d.ts +1 -4
  61. package/dist/typescript/lib/common/unitTestUtils.d.ts.map +1 -1
  62. package/dist/typescript/lib/index.d.ts +0 -1
  63. package/dist/typescript/lib/index.d.ts.map +1 -1
  64. package/dist/typescript/lib/internal/NativeFirebaseError.d.ts +1 -1
  65. package/dist/typescript/lib/internal/NativeFirebaseError.d.ts.map +1 -1
  66. package/dist/typescript/lib/internal/RNFBNativeEventEmitter.d.ts.map +1 -1
  67. package/dist/typescript/lib/internal/constants.d.ts +2 -3
  68. package/dist/typescript/lib/internal/constants.d.ts.map +1 -1
  69. package/dist/typescript/lib/internal/index.d.ts +1 -1
  70. package/dist/typescript/lib/internal/index.d.ts.map +1 -1
  71. package/dist/typescript/lib/internal/nativeModuleAndroidIos.d.ts +2 -6
  72. package/dist/typescript/lib/internal/nativeModuleAndroidIos.d.ts.map +1 -1
  73. package/dist/typescript/lib/internal/nativeModuleWeb.d.ts.map +1 -1
  74. package/dist/typescript/lib/internal/registry/app.d.ts +2 -2
  75. package/dist/typescript/lib/internal/registry/app.d.ts.map +1 -1
  76. package/dist/typescript/lib/internal/registry/modular.d.ts +22 -0
  77. package/dist/typescript/lib/internal/registry/modular.d.ts.map +1 -0
  78. package/dist/typescript/lib/internal/registry/nativeModule.d.ts +3 -11
  79. package/dist/typescript/lib/internal/registry/nativeModule.d.ts.map +1 -1
  80. package/dist/typescript/lib/modular.d.ts +21 -7
  81. package/dist/typescript/lib/modular.d.ts.map +1 -1
  82. package/dist/typescript/lib/types/app.d.ts +4 -4
  83. package/dist/typescript/lib/types/app.d.ts.map +1 -1
  84. package/dist/typescript/lib/types/internal.d.ts +1 -33
  85. package/dist/typescript/lib/types/internal.d.ts.map +1 -1
  86. package/dist/typescript/lib/utils/index.d.ts +7 -3
  87. package/dist/typescript/lib/utils/index.d.ts.map +1 -1
  88. package/dist/typescript/lib/version.d.ts +1 -1
  89. package/firebase-schema.json +5 -1
  90. package/ios/RNFBApp/RNFBAppModule.h +1 -3
  91. package/ios/RNFBApp/{RNFBAppModule.m → RNFBAppModule.mm} +74 -77
  92. package/ios/RNFBApp/RNFBUtilsModule.h +1 -3
  93. package/ios/RNFBApp/{RNFBUtilsModule.m → RNFBUtilsModule.mm} +68 -25
  94. package/ios/RNFBApp/RNFBVersion.m +1 -1
  95. package/ios/RNFBApp.xcodeproj/project.pbxproj +12 -12
  96. package/ios/generated/RCTAppDependencyProvider.h +25 -0
  97. package/ios/generated/RCTAppDependencyProvider.mm +55 -0
  98. package/ios/generated/RCTModuleProviders.h +16 -0
  99. package/ios/generated/RCTModuleProviders.mm +52 -0
  100. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  101. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  102. package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
  103. package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
  104. package/ios/generated/RCTUnstableModulesRequiringMainQueueSetupProvider.h +14 -0
  105. package/ios/generated/RCTUnstableModulesRequiringMainQueueSetupProvider.mm +19 -0
  106. package/ios/generated/RNFBAppTurboModules/RNFBAppTurboModules-generated.mm +210 -0
  107. package/ios/generated/RNFBAppTurboModules/RNFBAppTurboModules.h +399 -0
  108. package/ios/generated/RNFBAppTurboModulesJSI-generated.cpp +187 -0
  109. package/ios/generated/RNFBAppTurboModulesJSI.h +606 -0
  110. package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
  111. package/ios/generated/ReactCodegen.podspec +111 -0
  112. package/lib/FirebaseApp.ts +1 -10
  113. package/lib/common/index.ts +0 -742
  114. package/lib/common/unitTestUtils.ts +17 -73
  115. package/lib/index.ts +0 -1
  116. package/lib/internal/NativeFirebaseError.ts +1 -1
  117. package/lib/internal/RNFBNativeEventEmitter.ts +12 -6
  118. package/lib/internal/constants.ts +3 -25
  119. package/lib/internal/global.d.ts +0 -4
  120. package/lib/internal/index.ts +1 -1
  121. package/lib/internal/nativeModuleAndroidIos.ts +69 -12
  122. package/lib/internal/nativeModuleWeb.ts +11 -5
  123. package/lib/internal/registry/app.ts +24 -22
  124. package/lib/internal/registry/modular.ts +97 -0
  125. package/lib/internal/registry/nativeModule.ts +136 -107
  126. package/lib/modular.ts +47 -72
  127. package/lib/types/app.ts +6 -11
  128. package/lib/types/internal.ts +1 -46
  129. package/lib/utils/UtilsStatics.ts +2 -2
  130. package/lib/utils/index.ts +24 -18
  131. package/lib/version.ts +1 -1
  132. package/package.json +41 -3
  133. package/plugin/build/app.plugin.d.ts +2 -0
  134. package/plugin/build/app.plugin.js +6 -0
  135. package/plugin/src/app.plugin.ts +3 -0
  136. package/plugin/tsconfig.tsbuildinfo +1 -1
  137. package/react-native.config.js +2 -0
  138. package/specs/NativeRNFBTurboApp.ts +57 -0
  139. package/specs/NativeRNFBTurboUtils.ts +34 -0
  140. package/typedoc.json +1 -2
  141. package/dist/module/internal/registry/namespace.js +0 -262
  142. package/dist/module/internal/registry/namespace.js.map +0 -1
  143. package/dist/module/namespaced.js +0 -25
  144. package/dist/module/namespaced.js.map +0 -1
  145. package/dist/typescript/lib/internal/registry/namespace.d.ts +0 -26
  146. package/dist/typescript/lib/internal/registry/namespace.d.ts.map +0 -1
  147. package/dist/typescript/lib/namespaced.d.ts +0 -5
  148. package/dist/typescript/lib/namespaced.d.ts.map +0 -1
  149. package/lib/internal/registry/namespace.ts +0 -338
  150. package/lib/namespaced.ts +0 -24
package/CHANGELOG.md CHANGED
@@ -3,6 +3,49 @@
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
+ ## [26.0.0](https://github.com/invertase/react-native-firebase/compare/v25.1.0...v26.0.0) (2026-07-29)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ - **app, android:** On Android, makePlayServicesAvailable previously resolved even when the Play Services availability task was canceled or failed. It may now reject, so callers should handle Promise rejections.
11
+ - **phone-number-verification:** migrate phone-number-verification to TurboModules
12
+ - **auth:** migrate auth to TurboModules
13
+ - **database:** migrate database to TurboModules
14
+ - **messaging:** messaging requires the React Native New Architecture.
15
+ - **installations:** migrate installations to TurboModules
16
+ - **app:** App/Core modules native bridge requires New Architecture.
17
+
18
+ Migrate RNFBAppModule and RNFBUtilsModule to Codegen TurboModules with
19
+ unified resolver, lazy Proxy wrapper, and committed generated artifacts.
20
+ Includes functions codegenConfig rename (NewArch-AD-7), test harness
21
+ overrides, architecture decisions, and validation workflow hardening.
22
+
23
+ ### Features
24
+
25
+ - **app:** migrate app modules to TurboModules incl general migration infra ([978168d](https://github.com/invertase/react-native-firebase/commit/978168dacecf4925d347d9757eff73ee43e1484f))
26
+ - **auth:** migrate auth to TurboModules ([5fe09ac](https://github.com/invertase/react-native-firebase/commit/5fe09ac77b8df94631dbcfaa533cdcba0bfff98c))
27
+ - **database:** migrate database to TurboModules ([27ad35c](https://github.com/invertase/react-native-firebase/commit/27ad35cee5d8b13514c6432226b087266efc0012))
28
+ - **installations:** migrate installations to TurboModules ([4097d25](https://github.com/invertase/react-native-firebase/commit/4097d25eaced7bb31bca886d74531714b057feb1))
29
+ - **messaging:** migrate messaging to TurboModules ([e56c7f4](https://github.com/invertase/react-native-firebase/commit/e56c7f406920a21c07ccd1810b0315ec0953aeff))
30
+ - **phone-number-verification:** migrate phone-number-verification to TurboModules ([d7311c4](https://github.com/invertase/react-native-firebase/commit/d7311c482ef38b7ff1db24684e1ae9f3c5e47202))
31
+
32
+ ### Bug Fixes
33
+
34
+ - add codegen verify and spec-native parity tests ([49d9f1b](https://github.com/invertase/react-native-firebase/commit/49d9f1baba4fc83c1dd4983f582bbd7352d78809))
35
+ - add ResultT codegen type alias ([ff2d68f](https://github.com/invertase/react-native-firebase/commit/ff2d68ff8f73092f8ba3c75e007049dd31be822f))
36
+ - **app, android:** handle possible null external storage directory ([726493d](https://github.com/invertase/react-native-firebase/commit/726493d11d8ab23cb2ab7b9ab2103b40af52ff01))
37
+ - **app, android:** harden emitter attach/emit across generation overlap ([5dfef91](https://github.com/invertase/react-native-firebase/commit/5dfef91e4011f229fdedc3a54f2596ff60412719))
38
+ - **app, android:** run makeGooglePlayServicesAvailable on main thread ([9675467](https://github.com/invertase/react-native-firebase/commit/96754677c80109c92f0a53134e3fd845345d62f4))
39
+ - **app, android:** stop event emitter losing events to a stale ReactContext ([01992f7](https://github.com/invertase/react-native-firebase/commit/01992f7ff12864156c110b82b7895c6a912fd4d8)), closes [#1127](https://github.com/invertase/react-native-firebase/issues/1127) [#8374](https://github.com/invertase/react-native-firebase/issues/8374)
40
+ - **ios:** set IPHONEOS_DEPLOYMENT_TARGET to 15.0, update platform support docs/conditionals ([#9108](https://github.com/invertase/react-native-firebase/issues/9108)) ([99d0899](https://github.com/invertase/react-native-firebase/commit/99d089908e3eec6155d73ecf05ff7274ad33c46e)), closes [#8882](https://github.com/invertase/react-native-firebase/issues/8882)
41
+ - **messaging, android:** make max stored notifications configurable ([#9111](https://github.com/invertase/react-native-firebase/issues/9111)) ([dc5771f](https://github.com/invertase/react-native-firebase/commit/dc5771f75e599db362c2c9916490284734746ec0)), closes [#8771](https://github.com/invertase/react-native-firebase/issues/8771)
42
+ - resolve CI lint and spec-native parity failures ([6ff817e](https://github.com/invertase/react-native-firebase/commit/6ff817ed2154b2d4e77c5fd9709ec0eb95b408fa))
43
+ - **types:** align compare-types modular API with firebase-js-sdk ([5376e75](https://github.com/invertase/react-native-firebase/commit/5376e757f7dd7f7cffc9907c652d873d2403e23f))
44
+
45
+ ### Performance Improvements
46
+
47
+ - **app:** reduce TurboModule resolver overhead ([d5b5c9a](https://github.com/invertase/react-native-firebase/commit/d5b5c9a867575fa8ea8797ed5ebe410086e611d3))
48
+
6
49
  ## [25.1.0](https://github.com/invertase/react-native-firebase/compare/v25.0.1...v25.1.0) (2026-06-25)
7
50
 
8
51
  ### Bug Fixes
package/RNFBApp.podspec CHANGED
@@ -22,20 +22,14 @@ Pod::Spec.new do |s|
22
22
  s.macos.deployment_target = firebase_macos_target
23
23
  s.tvos.deployment_target = firebase_tvos_target
24
24
  s.cocoapods_version = '>= 1.12.0'
25
- s.source_files = "ios/**/*.{h,m}"
25
+ s.source_files = "ios/**/*.{h,m,mm,cpp}"
26
+ s.private_header_files = "ios/**/*.h"
27
+ s.exclude_files = 'ios/generated/RCTThirdPartyComponentsProvider.*', 'ios/generated/RCTAppDependencyProvider.*', 'ios/generated/RCTModuleProviders.*', 'ios/generated/RCTModulesConformingToProtocolsProvider.*', 'ios/generated/RCTUnstableModulesRequiringMainQueueSetupProvider.*'
26
28
 
27
- # Deprecation message for old architecture users
28
- # - safely in case the variable goes away completely in future react-native versions
29
- # - suppressable in case people need to
30
- if (
31
- defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil &&
32
- ENV["RCT_NEW_ARCH_ENABLED"] == '0' &&
33
- ENV["RNFB_SUPPRESS_NEW_ARCHITECTURE_WARNING"] != '1'
34
- )
35
- Pod::UI.puts '[react-native-firebase] '.yellow + "Legacy Architecture support is deprecated for all modules"
36
- Pod::UI.puts '[react-native-firebase] '.yellow + "New Architecture support is already required for some modules"
37
- Pod::UI.puts '[react-native-firebase] '.yellow + "all modules will require it in the future."
38
- Pod::UI.puts '[react-native-firebase] '.yellow + "Suppress this with environment variable RNFB_SUPPRESS_NEW_ARCHITECTURE_WARNING=1"
29
+ # Fail fast for old architecture users, but safely in case the variable goes away
30
+ # completely in future react-native versions
31
+ if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0')
32
+ raise "#{s.name} requires New Architecture. Enable New Architecture to use this module"
39
33
  end
40
34
 
41
35
  # App must define modules for static framework integration of other packages to work
@@ -92,6 +92,17 @@ android {
92
92
  sourceSets {
93
93
  main {
94
94
  java.srcDirs = ['src/main/java', 'src/reactnative/java']
95
+ java.excludes = ['**/generated/jni/**']
96
+ }
97
+ }
98
+
99
+ testOptions {
100
+ unitTests {
101
+ includeAndroidResources = true
102
+ all {
103
+ // Robolectric needs resources / manifests from the library + RN deps.
104
+ systemProperty 'robolectric.logging.enabled', 'true'
105
+ }
95
106
  }
96
107
  }
97
108
  }
@@ -105,6 +116,10 @@ dependencies {
105
116
  implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}")
106
117
  implementation "com.google.firebase:firebase-common"
107
118
  implementation "com.google.android.gms:play-services-auth:${ReactNative.ext.getVersion("play", "play-services-auth")}"
119
+
120
+ testImplementation "junit:junit:4.13.2"
121
+ testImplementation "org.robolectric:robolectric:4.14.1"
122
+ testImplementation "org.mockito:mockito-core:5.14.2"
108
123
  }
109
124
 
110
125
  def jvmVersion = Jvm.current().javaVersion?.majorVersion
@@ -132,12 +147,16 @@ def isNewArchitectureDisabled() {
132
147
  return project.hasProperty("newArchEnabled") && project.newArchEnabled != "true"
133
148
  }
134
149
 
135
- if (isNewArchitectureDisabled() && System.getenv('RNFB_SUPPRESS_NEW_ARCHITECTURE_WARNING') != 1) {
136
- def ANSI_YELLOW = "\u001B[33m";
150
+ if (isNewArchitectureDisabled()) {
151
+ def ANSI_RED = "\u001B[31m";
137
152
  def ANSI_RESET = "\u001B[0m";
138
153
 
139
- println(ANSI_YELLOW + " [react-native-firebase] Legacy Architecture support is deprecated for all modules")
140
- println(ANSI_YELLOW + " [react-native-firebase] New Architecture support is already required for some modules")
141
- println(ANSI_YELLOW + " [react-native-firebase] all modules will require it in the future.")
142
- println(ANSI_YELLOW + " [react-native-firebase] Suppress this with environment variable RNFB_SUPPRESS_NEW_ARCHITECTURE_WARNING=1" + ANSI_RESET)
154
+ println("\n\n\n")
155
+ println(ANSI_RED + "**************************************************************************************************************")
156
+ println("\n\n\n")
157
+ println("New Architecture support is required for @react-native-firebase/app")
158
+ println("\n\n\n")
159
+ println("**************************************************************************************************************" + ANSI_RESET)
160
+ println("\n\n\n")
161
+ System.exit(1)
143
162
  }
@@ -18,9 +18,10 @@ package io.invertase.firebase.app;
18
18
  */
19
19
 
20
20
  import android.util.Log;
21
+ import com.facebook.fbreact.specs.NativeRNFBTurboAppSpec;
22
+ import com.facebook.react.bridge.LifecycleEventListener;
21
23
  import com.facebook.react.bridge.Promise;
22
24
  import com.facebook.react.bridge.ReactApplicationContext;
23
- import com.facebook.react.bridge.ReactMethod;
24
25
  import com.facebook.react.bridge.ReadableMap;
25
26
  import com.facebook.react.bridge.WritableMap;
26
27
  import com.google.firebase.FirebaseApp;
@@ -29,33 +30,83 @@ import io.invertase.firebase.common.ReactNativeFirebaseEvent;
29
30
  import io.invertase.firebase.common.ReactNativeFirebaseEventEmitter;
30
31
  import io.invertase.firebase.common.ReactNativeFirebaseJSON;
31
32
  import io.invertase.firebase.common.ReactNativeFirebaseMeta;
32
- import io.invertase.firebase.common.ReactNativeFirebaseModule;
33
33
  import io.invertase.firebase.common.ReactNativeFirebasePreferences;
34
34
  import java.util.ArrayList;
35
35
  import java.util.HashMap;
36
36
  import java.util.List;
37
37
  import java.util.Map;
38
38
 
39
- public class ReactNativeFirebaseAppModule extends ReactNativeFirebaseModule {
39
+ public class NativeRNFBTurboApp extends NativeRNFBTurboAppSpec implements LifecycleEventListener {
40
40
  private static final String TAG = "App";
41
41
 
42
42
  public static Map<String, String> authDomains = new HashMap<>();
43
43
 
44
- ReactNativeFirebaseAppModule(ReactApplicationContext reactContext) {
45
- super(reactContext, TAG);
44
+ NativeRNFBTurboApp(ReactApplicationContext reactContext) {
45
+ super(reactContext);
46
46
  }
47
47
 
48
48
  @Override
49
49
  public void initialize() {
50
50
  super.initialize();
51
- ReactNativeFirebaseEventEmitter.getSharedInstance().attachReactContext(getContext());
51
+ ReactApplicationContext reactContext = getReactApplicationContext();
52
+ // Register unconditionally. When the host is already RESUMED, addLifecycleEventListener
53
+ // posts onHostResume onto the UI queue asynchronously (it is not a synchronous call), so
54
+ // the explicit attach below is the primary path; resume remains best-effort convergence
55
+ // for later host flips. Stale-generation attaches are rejected or held pending by
56
+ // attachReactContext's fail-closed current-context arbitration.
57
+ reactContext.addLifecycleEventListener(this);
58
+ ReactNativeFirebaseEventEmitter.getSharedInstance().attachReactContext(reactContext);
52
59
  }
53
60
 
54
- @ReactMethod
61
+ @Override
62
+ public void invalidate() {
63
+ ReactApplicationContext reactContext = getReactApplicationContext();
64
+ reactContext.removeLifecycleEventListener(this);
65
+ // Identity-guarded inside the emitter: only clears state belonging to this dying context,
66
+ // never state a replacement runtime has already installed.
67
+ ReactNativeFirebaseEventEmitter.getSharedInstance().detachReactContext(reactContext);
68
+ super.invalidate();
69
+ }
70
+
71
+ @Override
72
+ public void onHostResume() {
73
+ // Re-attaching also flushes any events queued while no runtime was able to receive them.
74
+ ReactNativeFirebaseEventEmitter.getSharedInstance()
75
+ .attachReactContext(getReactApplicationContext());
76
+ }
77
+
78
+ @Override
79
+ public void onHostPause() {
80
+ // no-op, required by LifecycleEventListener
81
+ }
82
+
83
+ @Override
84
+ public void onHostDestroy() {
85
+ // no-op, required by LifecycleEventListener
86
+ }
87
+
88
+ @Override
89
+ protected Map<String, Object> getTypedExportedConstants() {
90
+ Map<String, Object> constants = new HashMap<>();
91
+ List<Map<String, Object>> appsList = new ArrayList<>();
92
+ List<FirebaseApp> firebaseApps = FirebaseApp.getApps(getReactApplicationContext());
93
+
94
+ for (FirebaseApp app : firebaseApps) {
95
+ appsList.add(RCTConvertFirebase.firebaseAppToMap(app));
96
+ }
97
+
98
+ constants.put("NATIVE_FIREBASE_APPS", appsList);
99
+ constants.put("FIREBASE_RAW_JSON", ReactNativeFirebaseJSON.getSharedInstance().getRawJSON());
100
+
101
+ return constants;
102
+ }
103
+
104
+ @Override
55
105
  public void initializeApp(ReadableMap options, ReadableMap appConfig, Promise promise) {
56
106
  FirebaseApp firebaseApp =
57
- RCTConvertFirebase.readableMapToFirebaseApp(options, appConfig, getContext());
58
- ReactNativeFirebaseAppModule.configureAuthDomain(
107
+ RCTConvertFirebase.readableMapToFirebaseApp(
108
+ options, appConfig, getReactApplicationContext());
109
+ NativeRNFBTurboApp.configureAuthDomain(
59
110
  appConfig.getString("name"), options.getString("authDomain"));
60
111
 
61
112
  WritableMap firebaseAppMap = RCTConvertFirebase.firebaseAppToWritableMap(firebaseApp);
@@ -71,13 +122,13 @@ public class ReactNativeFirebaseAppModule extends ReactNativeFirebaseModule {
71
122
  }
72
123
  }
73
124
 
74
- @ReactMethod
75
- public void setAutomaticDataCollectionEnabled(String appName, Boolean enabled) {
125
+ @Override
126
+ public void setAutomaticDataCollectionEnabled(String appName, boolean enabled) {
76
127
  FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
77
128
  firebaseApp.setDataCollectionDefaultEnabled(enabled);
78
129
  }
79
130
 
80
- @ReactMethod
131
+ @Override
81
132
  public void deleteApp(String appName, Promise promise) {
82
133
  FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
83
134
 
@@ -88,19 +139,19 @@ public class ReactNativeFirebaseAppModule extends ReactNativeFirebaseModule {
88
139
  promise.resolve(null);
89
140
  }
90
141
 
91
- @ReactMethod
92
- public void eventsNotifyReady(Boolean ready) {
142
+ @Override
143
+ public void eventsNotifyReady(boolean ready) {
93
144
  ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance();
94
145
  emitter.notifyJsReady(ready);
95
146
  }
96
147
 
97
- @ReactMethod
148
+ @Override
98
149
  public void eventsGetListeners(Promise promise) {
99
150
  ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance();
100
151
  promise.resolve(emitter.getListenersMap());
101
152
  }
102
153
 
103
- @ReactMethod
154
+ @Override
104
155
  public void eventsPing(String eventName, ReadableMap eventBody, Promise promise) {
105
156
  ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance();
106
157
  emitter.sendEvent(
@@ -109,78 +160,63 @@ public class ReactNativeFirebaseAppModule extends ReactNativeFirebaseModule {
109
160
  promise.resolve(RCTConvertFirebase.readableMapToWritableMap(eventBody));
110
161
  }
111
162
 
112
- @ReactMethod
163
+ @Override
113
164
  public void eventsAddListener(String eventName) {
114
165
  ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance();
115
166
  emitter.addListener(eventName);
116
167
  }
117
168
 
118
- @ReactMethod
119
- public void eventsRemoveListener(String eventName, Boolean all) {
169
+ @Override
170
+ public void eventsRemoveListener(String eventName, boolean all) {
120
171
  ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance();
121
172
  emitter.removeListener(eventName, all);
122
173
  }
123
174
 
124
- @ReactMethod
175
+ @Override
125
176
  public void addListener(String eventName) {
126
177
  // Keep: Required for RN built in Event Emitter Calls.
127
178
  }
128
179
 
129
- @ReactMethod
130
- public void removeListeners(Integer count) {
180
+ @Override
181
+ public void removeListeners(double count) {
131
182
  // Keep: Required for RN built in Event Emitter Calls.
132
183
  }
133
184
 
134
- /** ------------------ META ------------------ */
135
- @ReactMethod
185
+ @Override
136
186
  public void metaGetAll(Promise promise) {
137
187
  promise.resolve(ReactNativeFirebaseMeta.getSharedInstance().getAll());
138
188
  }
139
189
 
140
- /** ------------------ JSON ------------------ */
141
- @ReactMethod
190
+ @Override
142
191
  public void jsonGetAll(Promise promise) {
143
192
  promise.resolve(ReactNativeFirebaseJSON.getSharedInstance().getAll());
144
193
  }
145
194
 
146
- /** ------------------ PREFERENCES ------------------ */
147
- @ReactMethod
195
+ @Override
148
196
  public void preferencesSetBool(String key, boolean value, Promise promise) {
149
197
  ReactNativeFirebasePreferences.getSharedInstance().setBooleanValue(key, value);
150
198
  promise.resolve(null);
151
199
  }
152
200
 
153
- @ReactMethod
201
+ @Override
154
202
  public void preferencesSetString(String key, String value, Promise promise) {
155
203
  ReactNativeFirebasePreferences.getSharedInstance().setStringValue(key, value);
156
204
  promise.resolve(null);
157
205
  }
158
206
 
159
- @ReactMethod
207
+ @Override
160
208
  public void preferencesGetAll(Promise promise) {
161
209
  promise.resolve(ReactNativeFirebasePreferences.getSharedInstance().getAll());
162
210
  }
163
211
 
164
- @ReactMethod
212
+ @Override
165
213
  public void preferencesClearAll(Promise promise) {
166
214
  ReactNativeFirebasePreferences.getSharedInstance().clearAll();
167
215
  promise.resolve(null);
168
216
  }
169
217
 
170
218
  @Override
171
- public Map<String, Object> getConstants() {
172
- Map<String, Object> constants = new HashMap<>();
173
- List<Map<String, Object>> appsList = new ArrayList<>();
174
- List<FirebaseApp> firebaseApps = FirebaseApp.getApps(getReactApplicationContext());
175
-
176
- for (FirebaseApp app : firebaseApps) {
177
- appsList.add(RCTConvertFirebase.firebaseAppToMap(app));
178
- }
179
-
180
- constants.put("NATIVE_FIREBASE_APPS", appsList);
181
-
182
- constants.put("FIREBASE_RAW_JSON", ReactNativeFirebaseJSON.getSharedInstance().getRawJSON());
183
-
184
- return constants;
219
+ public void setLogLevel(String logLevel) {
220
+ // Android uses Firebase SDK log level via manifest; no-op at runtime.
185
221
  }
186
222
  }
@@ -21,7 +21,7 @@ import com.facebook.react.ReactPackage;
21
21
  import com.facebook.react.bridge.NativeModule;
22
22
  import com.facebook.react.bridge.ReactApplicationContext;
23
23
  import com.facebook.react.uimanager.ViewManager;
24
- import io.invertase.firebase.utils.ReactNativeFirebaseUtilsModule;
24
+ import io.invertase.firebase.utils.NativeRNFBTurboUtils;
25
25
  import java.util.ArrayList;
26
26
  import java.util.Collections;
27
27
  import java.util.List;
@@ -36,8 +36,8 @@ public class ReactNativeFirebaseAppPackage implements ReactPackage {
36
36
  ReactNativeFirebaseApp.setApplicationContext(reactContext.getApplicationContext());
37
37
  }
38
38
  List<NativeModule> modules = new ArrayList<>();
39
- modules.add(new ReactNativeFirebaseAppModule(reactContext));
40
- modules.add(new ReactNativeFirebaseUtilsModule(reactContext));
39
+ modules.add(new NativeRNFBTurboApp(reactContext));
40
+ modules.add(new NativeRNFBTurboUtils(reactContext));
41
41
  return modules;
42
42
  }
43
43
 
@@ -1,5 +1,5 @@
1
-
2
1
  package io.invertase.firebase.app;
2
+
3
3
  /*
4
4
  * Copyright (c) 2016-present Invertase Limited & Contributors
5
5
  *
@@ -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 = "25.1.0";
21
+ public static String VERSION = "26.0.0";
22
22
  }
@@ -0,0 +1,136 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateModuleJavaSpec.js
9
+ *
10
+ * @nolint
11
+ */
12
+
13
+ package com.facebook.fbreact.specs;
14
+
15
+ import com.facebook.proguard.annotations.DoNotStrip;
16
+ import com.facebook.react.bridge.Promise;
17
+ import com.facebook.react.bridge.ReactApplicationContext;
18
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
19
+ import com.facebook.react.bridge.ReactMethod;
20
+ import com.facebook.react.bridge.ReadableMap;
21
+ import com.facebook.react.common.build.ReactBuildConfig;
22
+ import com.facebook.react.turbomodule.core.interfaces.TurboModule;
23
+ import java.util.Arrays;
24
+ import java.util.HashSet;
25
+ import java.util.Map;
26
+ import java.util.Set;
27
+ import javax.annotation.Nonnull;
28
+ import javax.annotation.Nullable;
29
+
30
+ public abstract class NativeRNFBTurboAppSpec extends ReactContextBaseJavaModule implements TurboModule {
31
+ public static final String NAME = "NativeRNFBTurboApp";
32
+
33
+ public NativeRNFBTurboAppSpec(ReactApplicationContext reactContext) {
34
+ super(reactContext);
35
+ }
36
+
37
+ @Override
38
+ public @Nonnull String getName() {
39
+ return NAME;
40
+ }
41
+
42
+ protected abstract Map<String, Object> getTypedExportedConstants();
43
+
44
+ @Override
45
+ @DoNotStrip
46
+ public final @Nullable Map<String, Object> getConstants() {
47
+ Map<String, Object> constants = getTypedExportedConstants();
48
+ if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) {
49
+ Set<String> obligatoryFlowConstants = new HashSet<>(Arrays.asList(
50
+ "FIREBASE_RAW_JSON",
51
+ "NATIVE_FIREBASE_APPS"
52
+ ));
53
+ Set<String> optionalFlowConstants = new HashSet<>();
54
+ Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
55
+ undeclaredConstants.removeAll(obligatoryFlowConstants);
56
+ undeclaredConstants.removeAll(optionalFlowConstants);
57
+ if (!undeclaredConstants.isEmpty()) {
58
+ throw new IllegalStateException(String.format("Native Module Flow doesn't declare constants: %s", undeclaredConstants));
59
+ }
60
+ undeclaredConstants = obligatoryFlowConstants;
61
+ undeclaredConstants.removeAll(constants.keySet());
62
+ if (!undeclaredConstants.isEmpty()) {
63
+ throw new IllegalStateException(String.format("Native Module doesn't fill in constants: %s", undeclaredConstants));
64
+ }
65
+ }
66
+ return constants;
67
+ }
68
+
69
+ @ReactMethod
70
+ @DoNotStrip
71
+ public abstract void initializeApp(ReadableMap options, ReadableMap appConfig, Promise promise);
72
+
73
+ @ReactMethod
74
+ @DoNotStrip
75
+ public abstract void setAutomaticDataCollectionEnabled(String appName, boolean enabled);
76
+
77
+ @ReactMethod
78
+ @DoNotStrip
79
+ public abstract void deleteApp(String appName, Promise promise);
80
+
81
+ @ReactMethod
82
+ @DoNotStrip
83
+ public abstract void eventsNotifyReady(boolean ready);
84
+
85
+ @ReactMethod
86
+ @DoNotStrip
87
+ public abstract void eventsGetListeners(Promise promise);
88
+
89
+ @ReactMethod
90
+ @DoNotStrip
91
+ public abstract void eventsPing(String eventName, ReadableMap eventBody, Promise promise);
92
+
93
+ @ReactMethod
94
+ @DoNotStrip
95
+ public abstract void eventsAddListener(String eventName);
96
+
97
+ @ReactMethod
98
+ @DoNotStrip
99
+ public abstract void eventsRemoveListener(String eventName, boolean all);
100
+
101
+ @ReactMethod
102
+ @DoNotStrip
103
+ public abstract void addListener(String eventName);
104
+
105
+ @ReactMethod
106
+ @DoNotStrip
107
+ public abstract void removeListeners(double count);
108
+
109
+ @ReactMethod
110
+ @DoNotStrip
111
+ public abstract void metaGetAll(Promise promise);
112
+
113
+ @ReactMethod
114
+ @DoNotStrip
115
+ public abstract void jsonGetAll(Promise promise);
116
+
117
+ @ReactMethod
118
+ @DoNotStrip
119
+ public abstract void preferencesSetBool(String key, boolean value, Promise promise);
120
+
121
+ @ReactMethod
122
+ @DoNotStrip
123
+ public abstract void preferencesSetString(String key, String value, Promise promise);
124
+
125
+ @ReactMethod
126
+ @DoNotStrip
127
+ public abstract void preferencesGetAll(Promise promise);
128
+
129
+ @ReactMethod
130
+ @DoNotStrip
131
+ public abstract void preferencesClearAll(Promise promise);
132
+
133
+ @ReactMethod
134
+ @DoNotStrip
135
+ public abstract void setLogLevel(String logLevel);
136
+ }
@@ -0,0 +1,94 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateModuleJavaSpec.js
9
+ *
10
+ * @nolint
11
+ */
12
+
13
+ package com.facebook.fbreact.specs;
14
+
15
+ import com.facebook.proguard.annotations.DoNotStrip;
16
+ import com.facebook.react.bridge.Promise;
17
+ import com.facebook.react.bridge.ReactApplicationContext;
18
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
19
+ import com.facebook.react.bridge.ReactMethod;
20
+ import com.facebook.react.common.build.ReactBuildConfig;
21
+ import com.facebook.react.turbomodule.core.interfaces.TurboModule;
22
+ import java.util.Arrays;
23
+ import java.util.HashSet;
24
+ import java.util.Map;
25
+ import java.util.Set;
26
+ import javax.annotation.Nonnull;
27
+ import javax.annotation.Nullable;
28
+
29
+ public abstract class NativeRNFBTurboUtilsSpec extends ReactContextBaseJavaModule implements TurboModule {
30
+ public static final String NAME = "NativeRNFBTurboUtils";
31
+
32
+ public NativeRNFBTurboUtilsSpec(ReactApplicationContext reactContext) {
33
+ super(reactContext);
34
+ }
35
+
36
+ @Override
37
+ public @Nonnull String getName() {
38
+ return NAME;
39
+ }
40
+
41
+ protected abstract Map<String, Object> getTypedExportedConstants();
42
+
43
+ @Override
44
+ @DoNotStrip
45
+ public final @Nullable Map<String, Object> getConstants() {
46
+ Map<String, Object> constants = getTypedExportedConstants();
47
+ if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) {
48
+ Set<String> obligatoryFlowConstants = new HashSet<>(Arrays.asList(
49
+ "CACHES_DIRECTORY",
50
+ "DOCUMENT_DIRECTORY",
51
+ "LIBRARY_DIRECTORY",
52
+ "MAIN_BUNDLE",
53
+ "MOVIES_DIRECTORY",
54
+ "PICTURES_DIRECTORY",
55
+ "TEMP_DIRECTORY",
56
+ "isRunningInTestLab"
57
+ ));
58
+ Set<String> optionalFlowConstants = new HashSet<>(Arrays.asList(
59
+ "EXTERNAL_DIRECTORY",
60
+ "EXTERNAL_STORAGE_DIRECTORY",
61
+ "FILE_TYPE_DIRECTORY",
62
+ "FILE_TYPE_REGULAR"
63
+ ));
64
+ Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
65
+ undeclaredConstants.removeAll(obligatoryFlowConstants);
66
+ undeclaredConstants.removeAll(optionalFlowConstants);
67
+ if (!undeclaredConstants.isEmpty()) {
68
+ throw new IllegalStateException(String.format("Native Module Flow doesn't declare constants: %s", undeclaredConstants));
69
+ }
70
+ undeclaredConstants = obligatoryFlowConstants;
71
+ undeclaredConstants.removeAll(constants.keySet());
72
+ if (!undeclaredConstants.isEmpty()) {
73
+ throw new IllegalStateException(String.format("Native Module doesn't fill in constants: %s", undeclaredConstants));
74
+ }
75
+ }
76
+ return constants;
77
+ }
78
+
79
+ @ReactMethod
80
+ @DoNotStrip
81
+ public abstract void androidGetPlayServicesStatus(Promise promise);
82
+
83
+ @ReactMethod
84
+ @DoNotStrip
85
+ public abstract void androidPromptForPlayServices(Promise promise);
86
+
87
+ @ReactMethod
88
+ @DoNotStrip
89
+ public abstract void androidResolutionForPlayServices(Promise promise);
90
+
91
+ @ReactMethod
92
+ @DoNotStrip
93
+ public abstract void androidMakePlayServicesAvailable(Promise promise);
94
+ }
@@ -0,0 +1,36 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ cmake_minimum_required(VERSION 3.13)
7
+ set(CMAKE_VERBOSE_MAKEFILE on)
8
+
9
+ file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNFBAppTurboModules/*.cpp)
10
+
11
+ add_library(
12
+ react_codegen_RNFBAppTurboModules
13
+ OBJECT
14
+ ${react_codegen_SRCS}
15
+ )
16
+
17
+ target_include_directories(react_codegen_RNFBAppTurboModules PUBLIC . react/renderer/components/RNFBAppTurboModules)
18
+
19
+ target_link_libraries(
20
+ react_codegen_RNFBAppTurboModules
21
+ fbjni
22
+ jsi
23
+ # We need to link different libraries based on whether we are building rncore or not, that's necessary
24
+ # because we want to break a circular dependency between react_codegen_rncore and reactnative
25
+ reactnative
26
+ )
27
+
28
+ target_compile_options(
29
+ react_codegen_RNFBAppTurboModules
30
+ PRIVATE
31
+ -DLOG_TAG=\"ReactNative\"
32
+ -fexceptions
33
+ -frtti
34
+ -std=c++20
35
+ -Wall
36
+ )