@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
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
package io.invertase.firebase.app;
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this library except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import android.content.Context;
|
|
21
|
-
import android.util.Log;
|
|
22
|
-
import com.google.firebase.FirebaseApp;
|
|
23
|
-
import com.google.firebase.FirebaseOptions;
|
|
24
|
-
|
|
25
|
-
public class ReactNativeFirebaseApp {
|
|
26
|
-
private static Context applicationContext;
|
|
27
|
-
|
|
28
|
-
public static Context getApplicationContext() {
|
|
29
|
-
return applicationContext;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
public static void setApplicationContext(Context applicationContext) {
|
|
33
|
-
Log.d("ReactNativeFirebaseApp", "received application context.");
|
|
34
|
-
ReactNativeFirebaseApp.applicationContext = applicationContext;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public static void initializeSecondaryApp(String name) {
|
|
38
|
-
FirebaseOptions options = FirebaseOptions.fromResource(applicationContext);
|
|
39
|
-
FirebaseApp.initializeApp(applicationContext, options, name);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
public static void initializeSecondaryApp(String name, Context applicationContext) {
|
|
43
|
-
FirebaseOptions options = FirebaseOptions.fromResource(applicationContext);
|
|
44
|
-
FirebaseApp.initializeApp(applicationContext, options, name);
|
|
45
|
-
}
|
|
46
|
-
}
|
package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppPackage.java
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
package io.invertase.firebase.app;
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this library except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import com.facebook.react.ReactPackage;
|
|
21
|
-
import com.facebook.react.bridge.NativeModule;
|
|
22
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
23
|
-
import com.facebook.react.uimanager.ViewManager;
|
|
24
|
-
import io.invertase.firebase.utils.NativeRNFBTurboUtils;
|
|
25
|
-
import java.util.ArrayList;
|
|
26
|
-
import java.util.Collections;
|
|
27
|
-
import java.util.List;
|
|
28
|
-
import javax.annotation.Nonnull;
|
|
29
|
-
|
|
30
|
-
@SuppressWarnings("unused")
|
|
31
|
-
public class ReactNativeFirebaseAppPackage implements ReactPackage {
|
|
32
|
-
@Nonnull
|
|
33
|
-
@Override
|
|
34
|
-
public List<NativeModule> createNativeModules(@Nonnull ReactApplicationContext reactContext) {
|
|
35
|
-
if (ReactNativeFirebaseApp.getApplicationContext() == null) {
|
|
36
|
-
ReactNativeFirebaseApp.setApplicationContext(reactContext.getApplicationContext());
|
|
37
|
-
}
|
|
38
|
-
List<NativeModule> modules = new ArrayList<>();
|
|
39
|
-
modules.add(new NativeRNFBTurboApp(reactContext));
|
|
40
|
-
modules.add(new NativeRNFBTurboUtils(reactContext));
|
|
41
|
-
return modules;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@Nonnull
|
|
45
|
-
@Override
|
|
46
|
-
public List<ViewManager> createViewManagers(@Nonnull ReactApplicationContext reactContext) {
|
|
47
|
-
return Collections.emptyList();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
package io.invertase.firebase.common;
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this library except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import android.content.Context;
|
|
21
|
-
import android.util.Log;
|
|
22
|
-
import com.facebook.react.bridge.Arguments;
|
|
23
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
24
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
25
|
-
import com.facebook.react.bridge.WritableMap;
|
|
26
|
-
import com.google.firebase.FirebaseApp;
|
|
27
|
-
import com.google.firebase.FirebaseOptions;
|
|
28
|
-
import io.invertase.firebase.app.NativeRNFBTurboApp;
|
|
29
|
-
import java.util.HashMap;
|
|
30
|
-
import java.util.List;
|
|
31
|
-
import java.util.Map;
|
|
32
|
-
import javax.annotation.Nullable;
|
|
33
|
-
|
|
34
|
-
/** Utilities to convert to and from React Native bridge formats. */
|
|
35
|
-
public class RCTConvertFirebase {
|
|
36
|
-
private static String TAG = "RCTConvertFirebase";
|
|
37
|
-
|
|
38
|
-
public static Map<String, Object> firebaseAppToMap(FirebaseApp firebaseApp) {
|
|
39
|
-
String name = firebaseApp.getName();
|
|
40
|
-
FirebaseOptions appOptions = firebaseApp.getOptions();
|
|
41
|
-
|
|
42
|
-
Map<String, Object> root = new HashMap<>();
|
|
43
|
-
Map<String, Object> options = new HashMap<>();
|
|
44
|
-
Map<String, Object> appConfig = new HashMap<>();
|
|
45
|
-
|
|
46
|
-
appConfig.put("name", name);
|
|
47
|
-
appConfig.put("automaticDataCollectionEnabled", firebaseApp.isDataCollectionDefaultEnabled());
|
|
48
|
-
|
|
49
|
-
// TODO: Salakar: Firebase SDK does not support reading this value
|
|
50
|
-
// appConfig.put("automaticResourceManagement", false);
|
|
51
|
-
|
|
52
|
-
options.put("apiKey", appOptions.getApiKey());
|
|
53
|
-
options.put("appId", appOptions.getApplicationId());
|
|
54
|
-
options.put("projectId", appOptions.getProjectId());
|
|
55
|
-
options.put("databaseURL", appOptions.getDatabaseUrl());
|
|
56
|
-
options.put("measurementId", appOptions.getGaTrackingId());
|
|
57
|
-
options.put("messagingSenderId", appOptions.getGcmSenderId());
|
|
58
|
-
options.put("storageBucket", appOptions.getStorageBucket());
|
|
59
|
-
|
|
60
|
-
if (NativeRNFBTurboApp.authDomains.get(name) != null) {
|
|
61
|
-
options.put("authDomain", NativeRNFBTurboApp.authDomains.get(name));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
root.put("options", options);
|
|
65
|
-
root.put("appConfig", appConfig);
|
|
66
|
-
|
|
67
|
-
return root;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
public static WritableMap firebaseAppToWritableMap(FirebaseApp firebaseApp) {
|
|
71
|
-
return Arguments.makeNativeMap(firebaseAppToMap(firebaseApp));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
public static FirebaseApp readableMapToFirebaseApp(
|
|
75
|
-
ReadableMap options, ReadableMap appConfig, Context context) {
|
|
76
|
-
FirebaseOptions.Builder builder = new FirebaseOptions.Builder();
|
|
77
|
-
|
|
78
|
-
String name = appConfig.getString("name");
|
|
79
|
-
|
|
80
|
-
builder.setApiKey(options.getString("apiKey"));
|
|
81
|
-
builder.setApplicationId(options.getString("appId"));
|
|
82
|
-
builder.setProjectId(options.getString("projectId"));
|
|
83
|
-
builder.setDatabaseUrl(options.getString("databaseURL"));
|
|
84
|
-
|
|
85
|
-
if (options.hasKey("measurementId")) {
|
|
86
|
-
builder.setGaTrackingId(options.getString("measurementId"));
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
builder.setStorageBucket(options.getString("storageBucket"));
|
|
90
|
-
builder.setGcmSenderId(options.getString("messagingSenderId"));
|
|
91
|
-
|
|
92
|
-
FirebaseApp firebaseApp;
|
|
93
|
-
if (name.equals("[DEFAULT]")) {
|
|
94
|
-
firebaseApp = FirebaseApp.initializeApp(context, builder.build());
|
|
95
|
-
} else {
|
|
96
|
-
firebaseApp = FirebaseApp.initializeApp(context, builder.build(), name);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (appConfig.hasKey("automaticDataCollectionEnabled")) {
|
|
100
|
-
firebaseApp.setDataCollectionDefaultEnabled(
|
|
101
|
-
Boolean.valueOf(appConfig.getBoolean("automaticDataCollectionEnabled")));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (appConfig.hasKey("automaticResourceManagement")) {
|
|
105
|
-
// https://developers.google.com/android/reference/com/google/firebase/FirebaseApp.html#setAutomaticResourceManagementEnabled(boolean)
|
|
106
|
-
firebaseApp.setAutomaticResourceManagementEnabled(
|
|
107
|
-
appConfig.getBoolean("automaticResourceManagement"));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return firebaseApp;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Takes a value and calls the appropriate setter for its type on the target map + key
|
|
115
|
-
*
|
|
116
|
-
* @param key String key to set on target map
|
|
117
|
-
* @param value Object value to set on target map
|
|
118
|
-
* @param map WritableMap target map to write the value to
|
|
119
|
-
*/
|
|
120
|
-
@SuppressWarnings("unchecked")
|
|
121
|
-
public static WritableMap mapPutValue(String key, @Nullable Object value, WritableMap map) {
|
|
122
|
-
if (value == null) {
|
|
123
|
-
map.putNull(key);
|
|
124
|
-
return map;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
String type = value.getClass().getName();
|
|
128
|
-
|
|
129
|
-
switch (type) {
|
|
130
|
-
case "java.lang.Boolean":
|
|
131
|
-
map.putBoolean(key, (Boolean) value);
|
|
132
|
-
break;
|
|
133
|
-
case "java.lang.Long":
|
|
134
|
-
Long longVal = (Long) value;
|
|
135
|
-
map.putDouble(key, (double) longVal);
|
|
136
|
-
break;
|
|
137
|
-
case "java.lang.Float":
|
|
138
|
-
float floatVal = (float) value;
|
|
139
|
-
map.putDouble(key, (double) floatVal);
|
|
140
|
-
break;
|
|
141
|
-
case "java.lang.Double":
|
|
142
|
-
map.putDouble(key, (Double) value);
|
|
143
|
-
break;
|
|
144
|
-
case "java.lang.Integer":
|
|
145
|
-
map.putInt(key, (int) value);
|
|
146
|
-
break;
|
|
147
|
-
case "java.lang.String":
|
|
148
|
-
map.putString(key, (String) value);
|
|
149
|
-
break;
|
|
150
|
-
case "org.json.JSONObject$1":
|
|
151
|
-
map.putString(key, value.toString());
|
|
152
|
-
break;
|
|
153
|
-
default:
|
|
154
|
-
if (List.class.isAssignableFrom(value.getClass())) {
|
|
155
|
-
map.putArray(key, Arguments.makeNativeArray((List<Object>) value));
|
|
156
|
-
} else if (Map.class.isAssignableFrom(value.getClass())) {
|
|
157
|
-
WritableMap childMap = Arguments.createMap();
|
|
158
|
-
Map<String, Object> valueMap = (Map<String, Object>) value;
|
|
159
|
-
|
|
160
|
-
for (Map.Entry<String, Object> entry : valueMap.entrySet()) {
|
|
161
|
-
mapPutValue(entry.getKey(), entry.getValue(), childMap);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
map.putMap(key, childMap);
|
|
165
|
-
} else {
|
|
166
|
-
Log.d(TAG, "utils:mapPutValue:unknownType:" + type);
|
|
167
|
-
map.putNull(key);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return map;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// TODO Remove me - also in SharedUtils
|
|
175
|
-
public static WritableMap readableMapToWritableMap(ReadableMap map) {
|
|
176
|
-
WritableMap writableMap = Arguments.createMap();
|
|
177
|
-
// https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/bridge/WritableNativeMap.java#L54
|
|
178
|
-
writableMap.merge(map);
|
|
179
|
-
return writableMap;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
public static Map<String, Object> toHashMap(ReadableMap readableMap) {
|
|
183
|
-
// https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeMap.java#L216
|
|
184
|
-
return readableMap.toHashMap();
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
public static List<Object> toArrayList(ReadableArray readableArray) {
|
|
188
|
-
// https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/bridge/ReadableNativeArray.java#L175
|
|
189
|
-
return readableArray.toArrayList();
|
|
190
|
-
}
|
|
191
|
-
}
|
package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEvent.java
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
package io.invertase.firebase.common;
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this library except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import com.facebook.react.bridge.WritableMap;
|
|
21
|
-
import io.invertase.firebase.interfaces.NativeEvent;
|
|
22
|
-
|
|
23
|
-
public class ReactNativeFirebaseEvent implements NativeEvent {
|
|
24
|
-
private String eventName;
|
|
25
|
-
private WritableMap eventBody;
|
|
26
|
-
private String firebaseAppName;
|
|
27
|
-
|
|
28
|
-
public ReactNativeFirebaseEvent(String eventName, WritableMap eventBody) {
|
|
29
|
-
this.eventName = eventName;
|
|
30
|
-
this.eventBody = eventBody;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
public ReactNativeFirebaseEvent(String eventName, WritableMap eventBody, String firebaseAppName) {
|
|
34
|
-
this.eventName = eventName;
|
|
35
|
-
this.eventBody = eventBody;
|
|
36
|
-
this.firebaseAppName = firebaseAppName;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@Override
|
|
40
|
-
public String getEventName() {
|
|
41
|
-
return eventName;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@Override
|
|
45
|
-
public WritableMap getEventBody() {
|
|
46
|
-
return eventBody;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@Override
|
|
50
|
-
public String getFirebaseAppName() {
|
|
51
|
-
return firebaseAppName;
|
|
52
|
-
}
|
|
53
|
-
}
|