@react-native-firebase/app 26.3.3 → 27.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.
- package/CHANGELOG.md +75 -0
- package/README.md +10 -27
- package/RNFBApp.podspec +13 -5
- package/android/build.gradle +3 -0
- package/android/src/main/java/io/invertase/firebase/common/RNFBHandleCollisionException.kt +29 -0
- package/android/src/main/java/io/invertase/firebase/common/RNFBHandleMap.kt +146 -0
- package/android/src/main/java/io/invertase/firebase/common/TaskExecutorService.kt +156 -0
- package/android/src/main/java/io/invertase/firebase/common/UniversalFirebaseModule.kt +44 -0
- package/android/src/main/java/io/invertase/firebase/common/UniversalFirebasePreferences.kt +100 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/NativeRNFBTurboApp.kt +250 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseApp.kt +64 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/{ReactNativeFirebaseAppInitProvider.java → ReactNativeFirebaseAppInitProvider.kt} +3 -4
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppPackage.kt +47 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppRegistrar.kt +33 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseVersion.java +1 -1
- package/android/src/reactnative/java/io/invertase/firebase/common/RCTConvertFirebase.kt +185 -0
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEvent.kt +35 -0
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.kt +662 -0
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseJSON.kt +103 -0
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseMeta.kt +96 -0
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseModule.kt +140 -0
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebasePreferences.kt +109 -0
- package/android/src/reactnative/java/io/invertase/firebase/common/SharedUtils.kt +451 -0
- package/android/src/reactnative/java/io/invertase/firebase/interfaces/{ContextProvider.java → ContextProvider.kt} +8 -8
- package/android/src/reactnative/java/io/invertase/firebase/interfaces/{NativeError.java → NativeError.kt} +8 -8
- package/android/src/reactnative/java/io/invertase/firebase/interfaces/{NativeEvent.java → NativeEvent.kt} +6 -6
- package/android/src/reactnative/java/io/invertase/firebase/utils/NativeRNFBTurboUtils.kt +219 -0
- package/android/src/test/java/expo/core/ModuleRegistry.java +9 -0
- package/android/src/test/java/io/invertase/firebase/app/NativeRNFBTurboAppTest.java +208 -60
- package/android/src/test/java/io/invertase/firebase/app/ReactNativeFirebaseAppComponentsJavaCompatibilityTest.java +70 -0
- package/android/src/test/java/io/invertase/firebase/app/ReactNativeFirebaseAppJavaCompatibilityTest.java +60 -0
- package/android/src/test/java/io/invertase/firebase/app/ReactNativeFirebaseAppPackageTest.java +165 -0
- package/android/src/test/java/io/invertase/firebase/app/ReactNativeFirebaseAppTest.kt +167 -0
- package/android/src/test/java/io/invertase/firebase/common/RCTConvertFirebaseJavaCompatibilityTest.java +112 -0
- package/android/src/test/java/io/invertase/firebase/common/RCTConvertFirebaseTest.kt +317 -0
- package/android/src/test/java/io/invertase/firebase/common/RNFBHandleMapTest.kt +309 -0
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitterJavaCompatibilityTest.java +176 -0
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitterTest.java +144 -13
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebaseEventTest.kt +61 -0
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebaseJSONJavaCompatibilityTest.java +85 -0
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebaseJSONTest.kt +296 -0
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebaseMetaJavaCompatibilityTest.java +67 -0
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebaseMetaTest.kt +246 -0
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebaseModuleTest.kt +254 -0
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebasePreferencesJavaCompatibilityTest.java +87 -0
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebasePreferencesTest.kt +260 -0
- package/android/src/test/java/io/invertase/firebase/common/SharedUtilsJavaCompatibilityTest.java +255 -0
- package/android/src/test/java/io/invertase/firebase/common/SharedUtilsTest.kt +674 -0
- package/android/src/test/java/io/invertase/firebase/common/TaskExecutorServiceTest.kt +290 -0
- package/android/src/test/java/io/invertase/firebase/common/UniversalFirebaseModuleJavaCompatibilityTest.java +178 -0
- package/android/src/test/java/io/invertase/firebase/common/UniversalFirebasePreferencesJavaCompatibilityTest.java +99 -0
- package/android/src/test/java/io/invertase/firebase/common/UniversalFirebasePreferencesTest.kt +217 -0
- package/android/src/test/java/io/invertase/firebase/commoncompat/ReactNativeFirebaseModuleJavaCompatibilityTest.java +176 -0
- package/android/src/test/java/io/invertase/firebase/commoncompat/ReactNativeFirebaseModuleKotlinCompatibilityTest.kt +52 -0
- package/android/src/test/java/io/invertase/firebase/interfaces/InterfacesJavaCompatibilityTest.java +144 -0
- package/android/src/test/java/io/invertase/firebase/interfaces/NativeEventTest.kt +56 -0
- package/android/src/test/java/io/invertase/firebase/utils/NativeRNFBTurboUtilsTest.java +517 -23
- package/dist/module/FirebaseApp.js +10 -0
- package/dist/module/FirebaseApp.js.map +1 -1
- package/dist/module/common/Base64.js +13 -21
- package/dist/module/common/Base64.js.map +1 -1
- package/dist/module/common/deeps.js +3 -0
- package/dist/module/common/deeps.js.map +1 -1
- package/dist/module/common/index.js +17 -9
- package/dist/module/common/index.js.map +1 -1
- package/dist/module/internal/FirebaseModule.js.map +1 -1
- package/dist/module/internal/RNFBNativeEventEmitter.js +12 -1
- package/dist/module/internal/RNFBNativeEventEmitter.js.map +1 -1
- package/dist/module/internal/SharedEventEmitter.js +3 -1
- package/dist/module/internal/SharedEventEmitter.js.map +1 -1
- package/dist/module/internal/asyncStorage.js +7 -11
- package/dist/module/internal/asyncStorage.js.map +1 -1
- package/dist/module/internal/index.js +1 -0
- package/dist/module/internal/index.js.map +1 -1
- package/dist/module/internal/logger.js +44 -40
- package/dist/module/internal/logger.js.map +1 -1
- package/dist/module/internal/nativeModuleAndroidIos.js +2 -29
- package/dist/module/internal/nativeModuleAndroidIos.js.map +1 -1
- package/dist/module/internal/nativeModuleDebug.js +74 -0
- package/dist/module/internal/nativeModuleDebug.js.map +1 -0
- package/dist/module/internal/nativeModuleWeb.js +9 -29
- package/dist/module/internal/nativeModuleWeb.js.map +1 -1
- package/dist/module/internal/registry/app.js +8 -2
- package/dist/module/internal/registry/app.js.map +1 -1
- package/dist/module/internal/registry/modular.js +2 -2
- package/dist/module/internal/registry/modular.js.map +1 -1
- package/dist/module/internal/registry/nativeModule.js +3 -3
- package/dist/module/internal/registry/nativeModule.js.map +1 -1
- package/dist/module/internal/web/RNFBAppModule.js +16 -15
- package/dist/module/internal/web/RNFBAppModule.js.map +1 -1
- package/dist/module/internal/web/memidb/lib/FakeEventTarget.js +3 -1
- package/dist/module/internal/web/memidb/lib/FakeEventTarget.js.map +1 -1
- package/dist/module/types/app.js.map +1 -1
- package/dist/module/types/internal.js +2 -0
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/FirebaseApp.d.ts +7 -0
- package/dist/typescript/lib/FirebaseApp.d.ts.map +1 -1
- package/dist/typescript/lib/common/Base64.d.ts.map +1 -1
- package/dist/typescript/lib/common/deeps.d.ts.map +1 -1
- package/dist/typescript/lib/common/index.d.ts.map +1 -1
- package/dist/typescript/lib/internal/FirebaseModule.d.ts +2 -3
- package/dist/typescript/lib/internal/FirebaseModule.d.ts.map +1 -1
- package/dist/typescript/lib/internal/NativeModules.d.ts +4 -1
- package/dist/typescript/lib/internal/NativeModules.d.ts.map +1 -1
- package/dist/typescript/lib/internal/RNFBNativeEventEmitter.d.ts +2 -2
- package/dist/typescript/lib/internal/RNFBNativeEventEmitter.d.ts.map +1 -1
- package/dist/typescript/lib/internal/SharedEventEmitter.d.ts +3 -3
- package/dist/typescript/lib/internal/SharedEventEmitter.d.ts.map +1 -1
- package/dist/typescript/lib/internal/asyncStorage.d.ts.map +1 -1
- package/dist/typescript/lib/internal/index.d.ts +1 -0
- package/dist/typescript/lib/internal/index.d.ts.map +1 -1
- package/dist/typescript/lib/internal/logger.d.ts.map +1 -1
- package/dist/typescript/lib/internal/nativeModuleAndroidIos.d.ts.map +1 -1
- package/dist/typescript/lib/internal/nativeModuleDebug.d.ts +2 -0
- package/dist/typescript/lib/internal/nativeModuleDebug.d.ts.map +1 -0
- package/dist/typescript/lib/internal/nativeModuleWeb.d.ts.map +1 -1
- package/dist/typescript/lib/internal/registry/app.d.ts.map +1 -1
- package/dist/typescript/lib/internal/web/RNFBAppModule.d.ts +7 -7
- package/dist/typescript/lib/internal/web/RNFBAppModule.d.ts.map +1 -1
- package/dist/typescript/lib/types/app.d.ts +10 -3
- package/dist/typescript/lib/types/app.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +12 -0
- package/dist/typescript/lib/types/internal.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/firebase-schema.json +5 -1
- package/firebase_spm.rb +552 -96
- package/ios/RNFBApp/RCTConvert+FIRApp.h +2 -5
- package/ios/RNFBApp/RCTConvert+FIRApp.m +11 -6
- package/ios/RNFBApp/RCTConvert+FIROptions.h +2 -5
- package/ios/RNFBApp/RCTConvert+FIROptions.m +11 -10
- package/ios/RNFBApp/RCTConvertFIRApp.swift +86 -0
- package/ios/RNFBApp/RCTConvertFIROptions.swift +259 -0
- package/ios/RNFBApp/RNFBAppCustomAuthDomains.swift +63 -0
- package/ios/RNFBApp/RNFBAppInitializeOptionsMapper.swift +113 -0
- package/ios/RNFBApp/RNFBAppLogLevelMapper.swift +53 -0
- package/ios/RNFBApp/RNFBAppModule+CustomAuthDomain.m +35 -0
- package/ios/RNFBApp/RNFBAppModule.h +6 -2
- package/ios/RNFBApp/RNFBAppModule.mm +67 -204
- package/ios/RNFBApp/RNFBAppModuleFirebase.swift +439 -0
- package/ios/RNFBApp/RNFBAppModuleImplementation.h +68 -0
- package/ios/RNFBApp/RNFBAppModuleImplementation.m +195 -0
- package/ios/RNFBApp/RNFBHandleMap.h +73 -0
- package/ios/RNFBApp/RNFBHandleMap.m +87 -0
- package/ios/RNFBApp/RNFBHandleMapStorage.swift +90 -0
- package/ios/RNFBApp/RNFBInitializeAppArguments.swift +82 -0
- package/ios/RNFBApp/RNFBJSON.m +22 -38
- package/ios/RNFBApp/RNFBJSONImplementation.swift +71 -0
- package/ios/RNFBApp/RNFBMeta.m +24 -26
- package/ios/RNFBApp/RNFBMetaStorage.swift +76 -0
- package/ios/RNFBApp/RNFBNullSentinelDecoding.swift +135 -0
- package/ios/RNFBApp/RNFBNullSentinelInterceptor.h +30 -3
- package/ios/RNFBApp/RNFBNullSentinelInterceptor.m +28 -5
- package/ios/RNFBApp/RNFBPreferences.m +22 -20
- package/ios/RNFBApp/RNFBPreferencesStorage.swift +101 -0
- package/ios/RNFBApp/RNFBRCTEventEmitter.m +36 -93
- package/ios/RNFBApp/RNFBRCTEventEmitterCore.swift +161 -0
- package/ios/RNFBApp/RNFBSharedUtils.h +2 -5
- package/ios/RNFBApp/RNFBSharedUtils.m +109 -197
- package/ios/RNFBApp/RNFBSharedUtilsConfig.swift +72 -0
- package/ios/RNFBApp/RNFBSharedUtilsFIRApp.swift +271 -0
- package/ios/RNFBApp/RNFBSharedUtilsFormatting.swift +59 -0
- package/ios/RNFBApp/RNFBSharedUtilsPromiseRejection.swift +88 -0
- package/ios/RNFBApp/RNFBUtilsHelpers.swift +116 -0
- package/ios/RNFBApp/RNFBUtilsModule+Foundation.m +44 -0
- package/ios/RNFBApp/RNFBUtilsModule+PhotoAssets.m +47 -0
- package/ios/RNFBApp/RNFBUtilsModule.h +11 -1
- package/ios/RNFBApp/RNFBUtilsModule.mm +10 -85
- package/ios/RNFBApp/RNFBUtilsModuleImplementation.h +32 -0
- package/ios/RNFBApp/RNFBUtilsModuleImplementation.m +56 -0
- package/ios/RNFBApp/RNFBVersion.m +1 -1
- package/ios/RNFBApp.xcodeproj/project.pbxproj +106 -0
- package/ios/RNFBAppUnitTests/HostStubs/FirebaseCore/FIRApp.m +171 -0
- package/ios/RNFBAppUnitTests/HostStubs/FirebaseCore/FirebaseCore.h +78 -0
- package/ios/RNFBAppUnitTests/HostStubs/FirebaseInstallations/FIRInstallations.m +7 -0
- package/ios/RNFBAppUnitTests/HostStubs/FirebaseInstallations/FirebaseInstallations.h +8 -0
- package/ios/RNFBAppUnitTests/HostStubs/RNFBAppModuleHostStub.m +55 -0
- package/ios/RNFBAppUnitTests/HostStubs/RNFBAppTurboModules.h +89 -0
- package/ios/RNFBAppUnitTests/HostStubs/RNFBAppTurboModules.mm +30 -0
- package/ios/RNFBAppUnitTests/HostStubs/React/RCTBridge.h +19 -0
- package/ios/RNFBAppUnitTests/HostStubs/React/RCTBridge.m +32 -0
- package/ios/RNFBAppUnitTests/HostStubs/React/RCTBridgeModule.h +19 -0
- package/ios/RNFBAppUnitTests/HostStubs/React/RCTConvert.h +28 -0
- package/ios/RNFBAppUnitTests/HostStubs/React/RCTConvert.m +23 -0
- package/ios/RNFBAppUnitTests/HostStubs/React/RCTEventEmitter.h +9 -0
- package/ios/RNFBAppUnitTests/HostStubs/React/RCTInvalidating.h +24 -0
- package/ios/RNFBAppUnitTests/HostStubs/React/RCTUtils.h +9 -0
- package/ios/RNFBAppUnitTests/HostStubs/module.modulemap +13 -0
- package/ios/RNFBAppUnitTests/RCTConvertFIRAppFacadeTests.m +61 -0
- package/ios/RNFBAppUnitTests/RCTConvertFIRAppTests.swift +73 -0
- package/ios/RNFBAppUnitTests/RCTConvertFIROptionsFacadeTests.m +57 -0
- package/ios/RNFBAppUnitTests/RCTConvertFIROptionsTests.swift +243 -0
- package/ios/RNFBAppUnitTests/RNFBAppCustomAuthDomainsFacadeTests.m +73 -0
- package/ios/RNFBAppUnitTests/RNFBAppCustomAuthDomainsTests.swift +70 -0
- package/ios/RNFBAppUnitTests/RNFBAppInitializeOptionsMapperTests.swift +190 -0
- package/ios/RNFBAppUnitTests/RNFBAppLogLevelFacadeTests.m +76 -0
- package/ios/RNFBAppUnitTests/RNFBAppLogLevelMapperTests.swift +59 -0
- package/ios/RNFBAppUnitTests/RNFBAppModuleFirebaseFacadeTests.m +215 -0
- package/ios/RNFBAppUnitTests/RNFBAppModuleFirebaseTests.swift +430 -0
- package/ios/RNFBAppUnitTests/RNFBAppModuleLifecycleTests.m +206 -0
- package/ios/RNFBAppUnitTests/RNFBAppModuleShellTests.mm +367 -0
- package/ios/RNFBAppUnitTests/RNFBAppUnitTests.xcodeproj/project.pbxproj +590 -0
- package/ios/RNFBAppUnitTests/RNFBAppUnitTests.xcodeproj/xcshareddata/xcschemes/RNFBAppUnitTests.xcscheme +69 -0
- package/ios/RNFBAppUnitTests/RNFBFirebaseAppClientTests.swift +165 -0
- package/ios/RNFBAppUnitTests/RNFBHandleMapStorageTests.swift +121 -0
- package/ios/RNFBAppUnitTests/RNFBHandleMapTests.m +238 -0
- package/ios/RNFBAppUnitTests/RNFBInitializeAppArgumentsTests.swift +256 -0
- package/ios/RNFBAppUnitTests/RNFBJSONImplementationTests.swift +126 -0
- package/ios/RNFBAppUnitTests/RNFBJSONTests.m +172 -0
- package/ios/RNFBAppUnitTests/RNFBMetaStorageTests.swift +106 -0
- package/ios/RNFBAppUnitTests/RNFBMetaTests.m +65 -0
- package/ios/RNFBAppUnitTests/RNFBNullSentinelDecodingTests.swift +286 -0
- package/ios/RNFBAppUnitTests/RNFBNullSentinelInterceptorTests.m +312 -0
- package/ios/RNFBAppUnitTests/RNFBPreferencesStorageTests.swift +105 -0
- package/ios/RNFBAppUnitTests/RNFBPreferencesTests.m +110 -0
- package/ios/RNFBAppUnitTests/RNFBRCTEventEmitterCoreTests.swift +163 -0
- package/ios/RNFBAppUnitTests/RNFBRCTEventEmitterFacadeTests.m +141 -0
- package/ios/RNFBAppUnitTests/RNFBSharedUtilsConfigFacadeTests.m +100 -0
- package/ios/RNFBAppUnitTests/RNFBSharedUtilsConfigTests.swift +234 -0
- package/ios/RNFBAppUnitTests/RNFBSharedUtilsFIRAppFacadeTests.m +145 -0
- package/ios/RNFBAppUnitTests/RNFBSharedUtilsFIRAppTests.swift +173 -0
- package/ios/RNFBAppUnitTests/RNFBSharedUtilsFormattingFacadeTests.m +38 -0
- package/ios/RNFBAppUnitTests/RNFBSharedUtilsFormattingTests.swift +82 -0
- package/ios/RNFBAppUnitTests/RNFBSharedUtilsNullSentinelTests.m +35 -0
- package/ios/RNFBAppUnitTests/RNFBSharedUtilsPromiseRejectionFacadeTests.m +107 -0
- package/ios/RNFBAppUnitTests/RNFBSharedUtilsPromiseRejectionTests.swift +133 -0
- package/ios/RNFBAppUnitTests/RNFBUtilsHelpersTests.swift +144 -0
- package/ios/RNFBAppUnitTests/RNFBUtilsModuleFacadeTests.m +72 -0
- package/ios/RNFBAppUnitTests/RNFBUtilsModuleShellTests.mm +282 -0
- package/ios/RNFBFirebase/Package.swift +53 -0
- package/ios/RNFBFirebase/Sources/RNFBFirebase/RNFBFirebase.swift +285 -0
- package/ios/RNFBFirebase/Sources/RNFBFirebaseBridge/Public/.gitkeep +0 -0
- package/ios/RNFBFirebase/Sources/RNFBFirebaseBridge/RNFBFirebaseBridge.m +169 -0
- package/ios/RNFBFirebase/Sources/RNFBFirebaseBridge/include/RNFBFirebaseBridge.h +52 -0
- package/ios/RNFBFirebaseUnitTests/RNFBAppDynamicFacadeTests.swift +240 -0
- package/{android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppRegistrar.java → ios/RNFBFirebaseUnitTests/RNFBFirebaseClientImport.swift} +22 -17
- package/ios/RNFBFirebaseUnitTests/RNFBFirebaseUnitTests.xcodeproj/project.pbxproj +588 -0
- package/ios/RNFBFirebaseUnitTests/RNFBFirebaseUnitTests.xcodeproj/xcshareddata/xcschemes/RNFBFirebaseUnitTests.xcscheme +83 -0
- package/ios_config.sh +50 -22
- package/lib/FirebaseApp.ts +10 -0
- package/lib/common/Base64.ts +10 -16
- package/lib/common/deeps.ts +3 -0
- package/lib/common/index.ts +20 -9
- package/lib/internal/FirebaseModule.ts +6 -3
- package/lib/internal/NativeModules.ts +4 -1
- package/lib/internal/RNFBNativeEventEmitter.ts +14 -5
- package/lib/internal/SharedEventEmitter.ts +5 -1
- package/lib/internal/asyncStorage.ts +7 -11
- package/lib/internal/index.ts +1 -0
- package/lib/internal/logger.ts +53 -43
- package/lib/internal/nativeModuleAndroidIos.ts +2 -40
- package/lib/internal/nativeModuleDebug.ts +97 -0
- package/lib/internal/nativeModuleWeb.ts +10 -40
- package/lib/internal/react-native-vendor-emitter.d.ts +11 -0
- package/lib/internal/registry/app.ts +8 -2
- package/lib/internal/registry/modular.ts +2 -2
- package/lib/internal/registry/nativeModule.ts +3 -3
- package/lib/internal/web/RNFBAppModule.ts +16 -15
- package/lib/internal/web/memidb/lib/FakeEventTarget.js +3 -1
- package/lib/types/app.ts +10 -3
- package/lib/types/internal.ts +19 -0
- package/lib/version.ts +1 -1
- package/package.json +9 -8
- package/plugin/build/ios/appDelegate.js +19 -9
- package/plugin/build/ios/podfile.js +16 -16
- package/plugin/build/pluginConfig.d.ts +4 -2
- package/plugin/src/ios/appDelegate.ts +45 -15
- package/plugin/src/ios/podfile.ts +20 -23
- package/plugin/src/pluginConfig.ts +4 -2
- package/android/src/main/java/io/invertase/firebase/common/TaskExecutorService.java +0 -124
- package/android/src/main/java/io/invertase/firebase/common/UniversalFirebaseModule.java +0 -62
- package/android/src/main/java/io/invertase/firebase/common/UniversalFirebasePreferences.java +0 -91
- package/android/src/reactnative/java/io/invertase/firebase/app/NativeRNFBTurboApp.java +0 -222
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseApp.java +0 -46
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppPackage.java +0 -49
- package/android/src/reactnative/java/io/invertase/firebase/common/RCTConvertFirebase.java +0 -191
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEvent.java +0 -53
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java +0 -606
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseJSON.java +0 -107
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseMeta.java +0 -101
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseModule.java +0 -146
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebasePreferences.java +0 -96
- package/android/src/reactnative/java/io/invertase/firebase/common/SharedUtils.java +0 -441
- package/android/src/reactnative/java/io/invertase/firebase/utils/NativeRNFBTurboUtils.java +0 -223
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
|
|
3
|
+
function serializeDebugValue(value: unknown): string {
|
|
4
|
+
const seen = new WeakSet<object>();
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
const serialized = JSON.stringify(value, (_key, currentValue: unknown) => {
|
|
8
|
+
if (typeof currentValue === 'bigint') {
|
|
9
|
+
return `${currentValue}n`;
|
|
10
|
+
}
|
|
11
|
+
if (currentValue instanceof Error) {
|
|
12
|
+
return { name: currentValue.name, message: currentValue.message };
|
|
13
|
+
}
|
|
14
|
+
if (currentValue && typeof currentValue === 'object') {
|
|
15
|
+
if (seen.has(currentValue)) {
|
|
16
|
+
return '[Circular]';
|
|
17
|
+
}
|
|
18
|
+
seen.add(currentValue);
|
|
19
|
+
}
|
|
20
|
+
return currentValue;
|
|
21
|
+
});
|
|
22
|
+
return serialized ?? String(value);
|
|
23
|
+
} catch (_error) {
|
|
24
|
+
return '[Unserializable]';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function logDebug(message: string): void {
|
|
29
|
+
try {
|
|
30
|
+
console.debug(message);
|
|
31
|
+
} catch (_error) {
|
|
32
|
+
// Debug logging must not change native module behavior.
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function createNativeModuleDebugProxy(
|
|
37
|
+
moduleName: string,
|
|
38
|
+
nativeModule: Record<string, unknown>,
|
|
39
|
+
): Record<string, unknown> {
|
|
40
|
+
return new Proxy(nativeModule, {
|
|
41
|
+
ownKeys(target) {
|
|
42
|
+
const keys: string[] = [];
|
|
43
|
+
for (const key in target) {
|
|
44
|
+
keys.push(key);
|
|
45
|
+
}
|
|
46
|
+
return keys;
|
|
47
|
+
},
|
|
48
|
+
get: (_, name) => {
|
|
49
|
+
const prop = nativeModule[name as string];
|
|
50
|
+
if (typeof prop !== 'function') return prop;
|
|
51
|
+
|
|
52
|
+
return (...args: unknown[]) => {
|
|
53
|
+
logDebug(
|
|
54
|
+
`[RNFB->Native][🔵] ${moduleName}.${String(name)} -> ${serializeDebugValue(args)}`,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
let result: unknown;
|
|
58
|
+
try {
|
|
59
|
+
result = Reflect.apply(prop, nativeModule, args);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
logDebug(
|
|
62
|
+
`[RNFB<-Native][🔴] ${moduleName}.${String(name)} <- ${serializeDebugValue(error)}`,
|
|
63
|
+
);
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (
|
|
68
|
+
result &&
|
|
69
|
+
typeof result === 'object' &&
|
|
70
|
+
typeof (result as Promise<unknown>).then === 'function'
|
|
71
|
+
) {
|
|
72
|
+
return (result as Promise<unknown>).then(
|
|
73
|
+
resolvedValue => {
|
|
74
|
+
logDebug(
|
|
75
|
+
`[RNFB<-Native][🟢] ${moduleName}.${String(name)} <- ${serializeDebugValue(
|
|
76
|
+
resolvedValue,
|
|
77
|
+
)}`,
|
|
78
|
+
);
|
|
79
|
+
return resolvedValue;
|
|
80
|
+
},
|
|
81
|
+
error => {
|
|
82
|
+
logDebug(
|
|
83
|
+
`[RNFB<-Native][🔴] ${moduleName}.${String(name)} <- ${serializeDebugValue(error)}`,
|
|
84
|
+
);
|
|
85
|
+
throw error;
|
|
86
|
+
},
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
logDebug(
|
|
91
|
+
`[RNFB<-Native][🟢] ${moduleName}.${String(name)} <- ${serializeDebugValue(result)}`,
|
|
92
|
+
);
|
|
93
|
+
return result;
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
1
|
import RNFBAppModule from './web/RNFBAppModule';
|
|
3
2
|
import { APP_NATIVE_MODULE } from './constants';
|
|
3
|
+
import { createNativeModuleDebugProxy } from './nativeModuleDebug';
|
|
4
4
|
|
|
5
5
|
// Register before exporting getters — RNFBNativeEventEmitter instantiates during circular imports.
|
|
6
6
|
const nativeModuleRegistry: Record<string, Record<string, unknown>> = {
|
|
7
7
|
RNFBAppModule: RNFBAppModule as unknown as Record<string, unknown>,
|
|
8
8
|
[APP_NATIVE_MODULE]: RNFBAppModule as unknown as Record<string, unknown>,
|
|
9
9
|
};
|
|
10
|
+
const memoizedDebugProxies = new Map<string, Record<string, unknown>>();
|
|
10
11
|
|
|
11
12
|
export function getReactNativeModule(moduleName: string): Record<string, unknown> | undefined {
|
|
12
13
|
const nativeModule = nativeModuleRegistry[moduleName];
|
|
@@ -17,45 +18,13 @@ export function getReactNativeModule(moduleName: string): Record<string, unknown
|
|
|
17
18
|
if (!globalThis.RNFBDebug) {
|
|
18
19
|
return nativeModule;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
get: (_, name) => {
|
|
29
|
-
const prop = nativeModule[name as string];
|
|
30
|
-
if (typeof prop !== 'function') return prop;
|
|
31
|
-
return (...args: unknown[]) => {
|
|
32
|
-
console.debug(
|
|
33
|
-
`[RNFB->Native][🔵] ${moduleName}.${String(name)} -> ${JSON.stringify(args)}`,
|
|
34
|
-
);
|
|
35
|
-
const result: unknown = (prop as (...args: unknown[]) => unknown)(...args);
|
|
36
|
-
if (result && typeof result === 'object' && 'then' in result) {
|
|
37
|
-
return (result as Promise<unknown>).then(
|
|
38
|
-
(res: unknown) => {
|
|
39
|
-
console.debug(
|
|
40
|
-
`[RNFB<-Native][🟢] ${moduleName}.${String(name)} <- ${JSON.stringify(res)}`,
|
|
41
|
-
);
|
|
42
|
-
return res;
|
|
43
|
-
},
|
|
44
|
-
(err: unknown) => {
|
|
45
|
-
console.debug(
|
|
46
|
-
`[RNFB<-Native][🔴] ${moduleName}.${String(name)} <- ${JSON.stringify(err)}`,
|
|
47
|
-
);
|
|
48
|
-
throw err;
|
|
49
|
-
},
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
console.debug(
|
|
53
|
-
`[RNFB<-Native][🟢] ${moduleName}.${String(name)} <- ${JSON.stringify(result)}`,
|
|
54
|
-
);
|
|
55
|
-
return result;
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
});
|
|
21
|
+
|
|
22
|
+
let debugProxy = memoizedDebugProxies.get(moduleName);
|
|
23
|
+
if (!debugProxy) {
|
|
24
|
+
debugProxy = createNativeModuleDebugProxy(moduleName, nativeModule);
|
|
25
|
+
memoizedDebugProxies.set(moduleName, debugProxy);
|
|
26
|
+
}
|
|
27
|
+
return debugProxy;
|
|
59
28
|
}
|
|
60
29
|
|
|
61
30
|
export function setReactNativeModule(
|
|
@@ -63,4 +32,5 @@ export function setReactNativeModule(
|
|
|
63
32
|
nativeModule: Record<string, unknown>,
|
|
64
33
|
): void {
|
|
65
34
|
nativeModuleRegistry[moduleName] = nativeModule;
|
|
35
|
+
memoizedDebugProxies.delete(moduleName);
|
|
66
36
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare module 'react-native/Libraries/vendor/emitter/EventEmitter' {
|
|
2
|
+
export default class EventEmitter {
|
|
3
|
+
addListener(
|
|
4
|
+
eventType: string,
|
|
5
|
+
listener: (...args: Array<unknown>) => unknown,
|
|
6
|
+
context?: unknown,
|
|
7
|
+
): { remove(): void };
|
|
8
|
+
removeAllListeners(eventType?: string): void;
|
|
9
|
+
emit(eventType: string, ...args: Array<unknown>): void;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -27,7 +27,7 @@ type FirebaseAppConfig = ReactNativeFirebase.FirebaseAppConfig;
|
|
|
27
27
|
type FirebaseAppOptions = ReactNativeFirebase.FirebaseAppOptions;
|
|
28
28
|
type ReactNativeAsyncStorage = ReactNativeFirebase.ReactNativeAsyncStorage;
|
|
29
29
|
|
|
30
|
-
const APP_REGISTRY: Record<string, FirebaseApp> =
|
|
30
|
+
const APP_REGISTRY: Record<string, FirebaseApp> = Object.create(null);
|
|
31
31
|
let onAppCreateFn: ((app: FirebaseApp) => void) | null = null;
|
|
32
32
|
const onAppDestroyCallbacks: Array<(app: FirebaseApp) => void> = [];
|
|
33
33
|
let initializedNativeApps = false;
|
|
@@ -191,7 +191,13 @@ export function initializeApp(
|
|
|
191
191
|
|
|
192
192
|
return getAppModule()
|
|
193
193
|
.initializeApp(options as FirebaseAppOptions, appConfig)
|
|
194
|
-
.then(
|
|
194
|
+
.then(nativeResult => {
|
|
195
|
+
// Native resolves the real SDK flag, which differs from the input when the key was omitted
|
|
196
|
+
// (SDK / Info.plist default). Web echoes the input and Jest mocks resolve void; both keep `!!input`.
|
|
197
|
+
const nativeEnabled = nativeResult?.appConfig?.automaticDataCollectionEnabled;
|
|
198
|
+
if (typeof nativeEnabled === 'boolean') {
|
|
199
|
+
app._setAutomaticDataCollectionEnabledFromNative(nativeEnabled);
|
|
200
|
+
}
|
|
195
201
|
app._initialized = true;
|
|
196
202
|
return app as unknown as ReactNativeFirebase.FirebaseApp;
|
|
197
203
|
})
|
|
@@ -31,7 +31,7 @@ type ModularModuleClass<T extends FirebaseModule> = new (
|
|
|
31
31
|
) => T;
|
|
32
32
|
|
|
33
33
|
// app.name -> instanceKey -> module instance
|
|
34
|
-
const MODULAR_INSTANCES: Record<string, Record<string, FirebaseModule>> =
|
|
34
|
+
const MODULAR_INSTANCES: Record<string, Record<string, FirebaseModule>> = Object.create(null);
|
|
35
35
|
|
|
36
36
|
let destroyHookRegistered = false;
|
|
37
37
|
function ensureDestroyHook(): void {
|
|
@@ -82,7 +82,7 @@ export function getOrCreateModularInstance<T extends FirebaseModule>(
|
|
|
82
82
|
const key = customUrlOrRegion ? `${customUrlOrRegion}:${namespace}` : namespace;
|
|
83
83
|
|
|
84
84
|
if (!MODULAR_INSTANCES[_app.name]) {
|
|
85
|
-
MODULAR_INSTANCES[_app.name] =
|
|
85
|
+
MODULAR_INSTANCES[_app.name] = Object.create(null);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
if (!MODULAR_INSTANCES[_app.name]![key]) {
|
|
@@ -80,9 +80,9 @@ function createRoutingCompositeProxy(
|
|
|
80
80
|
hosts: Array<{ module: Record<string, unknown> | undefined; argToPrepend: unknown[] }>,
|
|
81
81
|
isTurboModule: boolean,
|
|
82
82
|
): WrappedNativeModule {
|
|
83
|
-
const routingMap: Record<string, RouteEntry> =
|
|
84
|
-
const memoizedMethods: Record<string, (...args: unknown[]) => unknown> =
|
|
85
|
-
const memoizedConstants: Record<string, unknown> =
|
|
83
|
+
const routingMap: Record<string, RouteEntry> = Object.create(null);
|
|
84
|
+
const memoizedMethods: Record<string, (...args: unknown[]) => unknown> = Object.create(null);
|
|
85
|
+
const memoizedConstants: Record<string, unknown> = Object.create(null);
|
|
86
86
|
|
|
87
87
|
for (const { module, argToPrepend } of hosts) {
|
|
88
88
|
if (!module) {
|
|
@@ -48,22 +48,22 @@ interface InitializeAppResult {
|
|
|
48
48
|
let jsReady = false;
|
|
49
49
|
let jsListenerCount = 0;
|
|
50
50
|
let queuedEvents: QueuedEvent[] = [];
|
|
51
|
-
let jsListeners: EventListeners =
|
|
51
|
+
let jsListeners: EventListeners = Object.create(null);
|
|
52
52
|
|
|
53
53
|
// For compatibility we have a fake preferences storage,
|
|
54
54
|
// it does not persist across app restarts.
|
|
55
|
-
let fakePreferencesStorage: PreferencesStorage =
|
|
55
|
+
let fakePreferencesStorage: PreferencesStorage = Object.create(null);
|
|
56
56
|
|
|
57
57
|
function eventsGetListenersMap(): ListenersMap {
|
|
58
58
|
return {
|
|
59
59
|
listeners: jsListenerCount,
|
|
60
60
|
queued: queuedEvents.length,
|
|
61
|
-
events: jsListeners,
|
|
61
|
+
events: Object.assign(Object.create(null), jsListeners),
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
function eventsSendEvent(eventName: string, eventBody: any): void {
|
|
66
|
-
if (!jsReady || !
|
|
66
|
+
if (!jsReady || !Object.prototype.hasOwnProperty.call(jsListeners, eventName)) {
|
|
67
67
|
const event: QueuedEvent = {
|
|
68
68
|
eventName,
|
|
69
69
|
eventBody,
|
|
@@ -174,7 +174,7 @@ export default {
|
|
|
174
174
|
*
|
|
175
175
|
* @returns The meta data
|
|
176
176
|
*/
|
|
177
|
-
metaGetAll(): Record<string, never
|
|
177
|
+
async metaGetAll(): Promise<Record<string, never>> {
|
|
178
178
|
return {};
|
|
179
179
|
},
|
|
180
180
|
|
|
@@ -184,7 +184,7 @@ export default {
|
|
|
184
184
|
*
|
|
185
185
|
* @returns The JSON data for the firebase.json file.
|
|
186
186
|
*/
|
|
187
|
-
jsonGetAll(): Record<string, never
|
|
187
|
+
async jsonGetAll(): Promise<Record<string, never>> {
|
|
188
188
|
return {};
|
|
189
189
|
},
|
|
190
190
|
|
|
@@ -206,7 +206,7 @@ export default {
|
|
|
206
206
|
* @param key - The key of the preference.
|
|
207
207
|
* @param value - The value to set.
|
|
208
208
|
*/
|
|
209
|
-
preferencesSetString(key: string, value: string): void {
|
|
209
|
+
async preferencesSetString(key: string, value: string): Promise<void> {
|
|
210
210
|
fakePreferencesStorage[key] = value;
|
|
211
211
|
},
|
|
212
212
|
|
|
@@ -216,16 +216,16 @@ export default {
|
|
|
216
216
|
*
|
|
217
217
|
* @returns The preferences.
|
|
218
218
|
*/
|
|
219
|
-
preferencesGetAll(): PreferencesStorage {
|
|
220
|
-
return Object.assign(
|
|
219
|
+
async preferencesGetAll(): Promise<PreferencesStorage> {
|
|
220
|
+
return Object.assign(Object.create(null), fakePreferencesStorage);
|
|
221
221
|
},
|
|
222
222
|
|
|
223
223
|
/**
|
|
224
224
|
* Clears all preferences.
|
|
225
225
|
* Unsupported on web.
|
|
226
226
|
*/
|
|
227
|
-
preferencesClearAll(): void {
|
|
228
|
-
fakePreferencesStorage =
|
|
227
|
+
async preferencesClearAll(): Promise<void> {
|
|
228
|
+
fakePreferencesStorage = Object.create(null);
|
|
229
229
|
},
|
|
230
230
|
|
|
231
231
|
/**
|
|
@@ -269,7 +269,7 @@ export default {
|
|
|
269
269
|
*
|
|
270
270
|
* @returns The listeners for the event.
|
|
271
271
|
*/
|
|
272
|
-
eventsGetListeners(): ListenersMap {
|
|
272
|
+
async eventsGetListeners(): Promise<ListenersMap> {
|
|
273
273
|
return eventsGetListenersMap();
|
|
274
274
|
},
|
|
275
275
|
|
|
@@ -280,8 +280,9 @@ export default {
|
|
|
280
280
|
* @param eventBody - The body of the event to send.
|
|
281
281
|
* @returns void
|
|
282
282
|
*/
|
|
283
|
-
eventsPing(eventName: string, eventBody: any):
|
|
283
|
+
async eventsPing(eventName: string, eventBody: any): Promise<any> {
|
|
284
284
|
eventsSendEvent(eventName, eventBody);
|
|
285
|
+
return eventBody;
|
|
285
286
|
},
|
|
286
287
|
|
|
287
288
|
/**
|
|
@@ -291,7 +292,7 @@ export default {
|
|
|
291
292
|
*/
|
|
292
293
|
eventsAddListener(eventName: string): void {
|
|
293
294
|
jsListenerCount++;
|
|
294
|
-
if (!
|
|
295
|
+
if (!Object.prototype.hasOwnProperty.call(jsListeners, eventName)) {
|
|
295
296
|
jsListeners[eventName] = 1;
|
|
296
297
|
} else {
|
|
297
298
|
if (jsListeners[eventName] !== undefined) {
|
|
@@ -312,7 +313,7 @@ export default {
|
|
|
312
313
|
* @param all - Optional. Whether to remove all listeners for the event.
|
|
313
314
|
*/
|
|
314
315
|
eventsRemoveListener(eventName: string, all?: boolean): void {
|
|
315
|
-
if (
|
|
316
|
+
if (Object.prototype.hasOwnProperty.call(jsListeners, eventName)) {
|
|
316
317
|
const count = jsListeners[eventName];
|
|
317
318
|
if (count !== undefined) {
|
|
318
319
|
if (count <= 1 || all) {
|
|
@@ -66,7 +66,9 @@ class FakeEventTarget {
|
|
|
66
66
|
listener.type === type && listener.callback === callback && listener.capture === capture
|
|
67
67
|
);
|
|
68
68
|
});
|
|
69
|
-
|
|
69
|
+
if (i >= 0) {
|
|
70
|
+
this.listeners.splice(i, 1);
|
|
71
|
+
}
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
// http://www.w3.org/TR/dom/#dispatching-events
|
package/lib/types/app.ts
CHANGED
|
@@ -119,9 +119,13 @@ export namespace ReactNativeFirebase {
|
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
121
|
* Default setting for data collection on startup that affects all Firebase module startup data collection settings,
|
|
122
|
-
* in the absence of module-specific overrides.
|
|
123
|
-
* to false in firebase.json and may be used in opt-in flows, for example a GDPR-compliant app.
|
|
122
|
+
* in the absence of module-specific overrides. It may be used in opt-in flows, for example a GDPR-compliant app.
|
|
124
123
|
* If configured false initially, set to true after obtaining consent, then enable module-specific settings as needed afterwards.
|
|
124
|
+
*
|
|
125
|
+
* On iOS this starts as false if you set "app_data_collection_default_enabled" to false in firebase.json
|
|
126
|
+
* (written to Info.plist "FirebaseDataCollectionDefaultEnabled"). On Android that firebase.json key does not change
|
|
127
|
+
* this flag, which defaults to true unless the host app sets the manifest meta-data "firebase_data_collection_default_enabled".
|
|
128
|
+
* When omitted from the config passed to `initializeApp`, the native default is left unchanged on both platforms.
|
|
125
129
|
*/
|
|
126
130
|
automaticDataCollectionEnabled?: boolean;
|
|
127
131
|
|
|
@@ -148,7 +152,10 @@ export namespace ReactNativeFirebase {
|
|
|
148
152
|
readonly options: FirebaseAppOptions;
|
|
149
153
|
|
|
150
154
|
/**
|
|
151
|
-
* The settable config flag for GDPR opt-in/opt-out
|
|
155
|
+
* The settable config flag for GDPR opt-in/opt-out.
|
|
156
|
+
*
|
|
157
|
+
* After `initializeApp` resolves, this reflects the flag the native SDK is using, which can
|
|
158
|
+
* differ from the value passed in when the key was omitted.
|
|
152
159
|
*/
|
|
153
160
|
automaticDataCollectionEnabled: boolean;
|
|
154
161
|
|
package/lib/types/internal.ts
CHANGED
|
@@ -20,6 +20,25 @@
|
|
|
20
20
|
* These types are used internally across multiple files and should not be exported to consumers
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
+
import type { EventSubscription } from 'react-native';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* RN 0.88's generated `EventEmitter` class types require a `context` argument
|
|
27
|
+
* and `Object` payloads. The runtime still accepts the historical 2-argument
|
|
28
|
+
* `addListener` and nullable `emit` values used across modules.
|
|
29
|
+
*/
|
|
30
|
+
export interface ReactNativeFirebaseEventEmitter {
|
|
31
|
+
addListener(
|
|
32
|
+
eventType: string,
|
|
33
|
+
// RN 0.88 listener params are invariant; `any` keeps module-specific callbacks assignable.
|
|
34
|
+
listener: (...args: any[]) => any,
|
|
35
|
+
context?: unknown,
|
|
36
|
+
): EventSubscription;
|
|
37
|
+
emit(eventType: string, ...args: any[]): void;
|
|
38
|
+
removeAllListeners(eventType?: string | null): void;
|
|
39
|
+
listenerCount(eventType: string): number;
|
|
40
|
+
}
|
|
41
|
+
|
|
23
42
|
/**
|
|
24
43
|
* Firebase JSON configuration from firebase.json file
|
|
25
44
|
* Structure: { "react-native": { [key: string]: boolean | string }, ... }
|
package/lib/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '
|
|
2
|
+
export const version = '27.0.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-firebase/app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.0.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",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"compile": "bob build",
|
|
33
33
|
"prepare": "npm run build && npm run build:plugin && npm run compile"
|
|
34
34
|
},
|
|
35
|
+
"homepage": "https://rnfirebase.io",
|
|
35
36
|
"repository": {
|
|
36
37
|
"type": "git",
|
|
37
38
|
"url": "https://github.com/invertase/react-native-firebase",
|
|
@@ -110,10 +111,10 @@
|
|
|
110
111
|
"peerDependencies": {
|
|
111
112
|
"expo": ">=47.0.0",
|
|
112
113
|
"react": "*",
|
|
113
|
-
"react-native": "
|
|
114
|
+
"react-native": ">=0.60.0-0"
|
|
114
115
|
},
|
|
115
116
|
"dependencies": {
|
|
116
|
-
"firebase": "
|
|
117
|
+
"firebase": "13.0.0"
|
|
117
118
|
},
|
|
118
119
|
"devDependencies": {
|
|
119
120
|
"expo": "^55.0.18",
|
|
@@ -130,17 +131,17 @@
|
|
|
130
131
|
},
|
|
131
132
|
"sdkVersions": {
|
|
132
133
|
"ios": {
|
|
133
|
-
"firebase": "
|
|
134
|
+
"firebase": "13.0.0",
|
|
134
135
|
"firebaseSpmUrl": "https://github.com/firebase/firebase-ios-sdk.git",
|
|
135
136
|
"iosTarget": "15.0",
|
|
136
|
-
"macosTarget": "
|
|
137
|
+
"macosTarget": "11.0",
|
|
137
138
|
"tvosTarget": "15.0"
|
|
138
139
|
},
|
|
139
140
|
"android": {
|
|
140
|
-
"minSdk":
|
|
141
|
+
"minSdk": 24,
|
|
141
142
|
"targetSdk": 34,
|
|
142
143
|
"compileSdk": 34,
|
|
143
|
-
"firebase": "
|
|
144
|
+
"firebase": "35.0.0",
|
|
144
145
|
"firebaseCrashlyticsGradle": "3.0.8",
|
|
145
146
|
"firebasePerfGradle": "2.0.2",
|
|
146
147
|
"gmsGoogleServicesGradle": "4.5.0",
|
|
@@ -184,5 +185,5 @@
|
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
},
|
|
187
|
-
"gitHead": "
|
|
188
|
+
"gitHead": "0c7e942bca361f1765abaf233bf447d795718eff"
|
|
188
189
|
}
|
|
@@ -10,6 +10,22 @@ exports.modifyAppDelegateAsync = modifyAppDelegateAsync;
|
|
|
10
10
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
11
11
|
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
12
12
|
const fs_1 = __importDefault(require("fs"));
|
|
13
|
+
function addImport(contents, importLine, existingImportMatcher, preferredAnchorMatcher, anyImportMatcher) {
|
|
14
|
+
if (existingImportMatcher.test(contents)) {
|
|
15
|
+
return contents;
|
|
16
|
+
}
|
|
17
|
+
const newline = contents.includes('\r\n') ? '\r\n' : '\n';
|
|
18
|
+
const preferredAnchor = preferredAnchorMatcher.exec(contents);
|
|
19
|
+
if (preferredAnchor?.index !== undefined) {
|
|
20
|
+
const insertionPoint = preferredAnchor.index + preferredAnchor[0].length;
|
|
21
|
+
return `${contents.slice(0, insertionPoint)}${newline}${importLine}${contents.slice(insertionPoint)}`;
|
|
22
|
+
}
|
|
23
|
+
const firstImport = anyImportMatcher.exec(contents);
|
|
24
|
+
if (firstImport?.index !== undefined) {
|
|
25
|
+
return `${contents.slice(0, firstImport.index)}${importLine}${newline}${contents.slice(firstImport.index)}`;
|
|
26
|
+
}
|
|
27
|
+
return `${importLine}${newline}${contents}`;
|
|
28
|
+
}
|
|
13
29
|
function modifyObjcAppDelegate(contents) {
|
|
14
30
|
const methodInvocationBlock = `[FIRApp configure];`;
|
|
15
31
|
// https://regex101.com/r/mPgaq6/1
|
|
@@ -18,10 +34,7 @@ function modifyObjcAppDelegate(contents) {
|
|
|
18
34
|
// if the above regex fails, we can use this one as a fallback:
|
|
19
35
|
const fallbackInvocationLineMatcher = /-\s*\(BOOL\)\s*application:\s*\(UIApplication\s*\*\s*\)\s*\w+\s+didFinishLaunchingWithOptions:/g;
|
|
20
36
|
// Add import
|
|
21
|
-
|
|
22
|
-
contents = contents.replace(/#import "AppDelegate.h"/g, `#import "AppDelegate.h"
|
|
23
|
-
#import <Firebase/Firebase.h>`);
|
|
24
|
-
}
|
|
37
|
+
contents = addImport(contents, '#import <Firebase/Firebase.h>', /^[ \t]*#import\s+<Firebase\/Firebase\.h>[ \t]*$/m, /^[ \t]*#import\s+"AppDelegate\.h"[ \t]*$/m, /^[ \t]*#import\b[^\r\n]*$/m);
|
|
25
38
|
// To avoid potential issues with existing changes from older plugin versions
|
|
26
39
|
if (contents.includes(methodInvocationBlock)) {
|
|
27
40
|
return contents;
|
|
@@ -61,12 +74,9 @@ function modifyObjcAppDelegate(contents) {
|
|
|
61
74
|
}
|
|
62
75
|
function modifySwiftAppDelegate(contents) {
|
|
63
76
|
const methodInvocationBlock = `FirebaseApp.configure()`;
|
|
64
|
-
const methodInvocationLineMatcher = /(?:self\.moduleName\s*=\s*"([^"]*)")|(?:factory\.startReactNative\()/;
|
|
77
|
+
const methodInvocationLineMatcher = /(?:self\.moduleName\s*=\s*"([^"]*)")|(?:factory\.startReactNative\()|(?:return\s+super\.application\(\s*application\s*,\s*didFinishLaunchingWithOptions:\s*launchOptions\s*\))/;
|
|
65
78
|
// Add import
|
|
66
|
-
|
|
67
|
-
contents = contents.replace(/import Expo/g, `import Expo
|
|
68
|
-
import FirebaseCore`);
|
|
69
|
-
}
|
|
79
|
+
contents = addImport(contents, 'import FirebaseCore', /^[ \t]*import\s+FirebaseCore[ \t]*$/m, /^[ \t]*(?:internal\s+)?import\s+Expo[ \t]*$/m, /^[ \t]*import\b[^\r\n]*$/m);
|
|
70
80
|
// To avoid potential issues with existing changes from older plugin versions
|
|
71
81
|
if (contents.includes(methodInvocationBlock)) {
|
|
72
82
|
return contents;
|
|
@@ -5,27 +5,27 @@ exports.setAppPodfileDisableSPM = setAppPodfileDisableSPM;
|
|
|
5
5
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
6
6
|
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
7
7
|
const TAG = '@react-native-firebase/app-disableSPM';
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const DISABLE_SPM_UNSUPPORTED = '[react-native-firebase] ios.disableSPM is no longer supported. ' +
|
|
9
|
+
'Firebase Apple SDK 13+ is distributed only through Swift Package Manager. ' +
|
|
10
|
+
'Remove `disableSPM` from the `@react-native-firebase/app` config plugin and ' +
|
|
11
|
+
'use dynamic frameworks (`expo-build-properties` ios.useFrameworks: "dynamic"). ' +
|
|
12
|
+
'See https://rnfirebase.io/ios-spm';
|
|
13
|
+
// Historically injected `$RNFirebaseDisableSPM = true` before target blocks.
|
|
14
|
+
// Firebase 13+ is SPM-only: enabling this option must fail loudly, and any
|
|
15
|
+
// leftover generated flag is stripped on prebuild.
|
|
13
16
|
function setAppPodfileDisableSPM(src, enabled = false) {
|
|
14
|
-
if (
|
|
15
|
-
|
|
17
|
+
if (enabled) {
|
|
18
|
+
throw new Error(DISABLE_SPM_UNSUPPORTED);
|
|
16
19
|
}
|
|
17
|
-
return (0, generateCode_1.
|
|
18
|
-
src,
|
|
19
|
-
newSrc: FLAG,
|
|
20
|
-
tag: TAG,
|
|
21
|
-
anchor: ANCHOR,
|
|
22
|
-
offset: 1,
|
|
23
|
-
comment: '#',
|
|
24
|
-
}).contents;
|
|
20
|
+
return (0, generateCode_1.removeGeneratedContents)(src, TAG) ?? src;
|
|
25
21
|
}
|
|
26
22
|
const withIosDisableSPM = (config, props) => {
|
|
23
|
+
if (props?.ios?.disableSPM === true) {
|
|
24
|
+
throw new Error(DISABLE_SPM_UNSUPPORTED);
|
|
25
|
+
}
|
|
27
26
|
return (0, config_plugins_1.withPodfile)(config, config => {
|
|
28
|
-
|
|
27
|
+
// Strip a leftover DisableSPM flag from older prebuilds; never re-add it.
|
|
28
|
+
config.modResults.contents = setAppPodfileDisableSPM(config.modResults.contents, false);
|
|
29
29
|
return config;
|
|
30
30
|
});
|
|
31
31
|
};
|
|
@@ -3,8 +3,10 @@ export interface PluginConfigType {
|
|
|
3
3
|
}
|
|
4
4
|
export interface PluginConfigTypeIos {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* @deprecated Firebase Apple SDK 13+ is SPM-only. Setting this to `true`
|
|
7
|
+
* fails Expo prebuild / `pod install` — CocoaPods no longer distributes Firebase.
|
|
8
|
+
* Remove this option and use `use_frameworks! :linkage => :dynamic` (via
|
|
9
|
+
* `expo-build-properties` `ios.useFrameworks: "dynamic"`).
|
|
8
10
|
*
|
|
9
11
|
* @platform ios iOS
|
|
10
12
|
*/
|