@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.
- package/CHANGELOG.md +43 -0
- package/RNFBApp.podspec +7 -13
- package/android/build.gradle +25 -6
- package/android/src/reactnative/java/io/invertase/firebase/app/{ReactNativeFirebaseAppModule.java → NativeRNFBTurboApp.java} +81 -45
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppPackage.java +3 -3
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseVersion.java +2 -2
- package/android/src/reactnative/java/io/invertase/firebase/app/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboAppSpec.java +136 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboUtilsSpec.java +94 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/CMakeLists.txt +36 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/RNFBAppTurboModules-generated.cpp +170 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/RNFBAppTurboModules.h +39 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/react/renderer/components/RNFBAppTurboModules/RNFBAppTurboModulesJSI-generated.cpp +187 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/generated/jni/react/renderer/components/RNFBAppTurboModules/RNFBAppTurboModulesJSI.h +606 -0
- package/android/src/reactnative/java/io/invertase/firebase/common/RCTConvertFirebase.java +3 -3
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitter.java +475 -20
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebaseMeta.java +8 -0
- package/android/src/reactnative/java/io/invertase/firebase/common/ReactNativeFirebasePreferences.java +8 -0
- package/android/src/reactnative/java/io/invertase/firebase/utils/{ReactNativeFirebaseUtilsModule.java → NativeRNFBTurboUtils.java} +57 -40
- package/android/src/test/java/io/invertase/firebase/app/NativeRNFBTurboAppTest.java +400 -0
- package/android/src/test/java/io/invertase/firebase/common/ReactNativeFirebaseEventEmitterTest.java +1823 -0
- package/app.plugin.js +1 -1
- package/dist/module/FirebaseApp.js +0 -9
- package/dist/module/FirebaseApp.js.map +1 -1
- package/dist/module/common/index.js +0 -645
- package/dist/module/common/index.js.map +1 -1
- package/dist/module/common/unitTestUtils.js +18 -54
- package/dist/module/common/unitTestUtils.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/internal/RNFBNativeEventEmitter.js +12 -6
- package/dist/module/internal/RNFBNativeEventEmitter.js.map +1 -1
- package/dist/module/internal/constants.js +2 -2
- package/dist/module/internal/constants.js.map +1 -1
- package/dist/module/internal/index.js +1 -1
- package/dist/module/internal/index.js.map +1 -1
- package/dist/module/internal/nativeModuleAndroidIos.js +50 -10
- package/dist/module/internal/nativeModuleAndroidIos.js.map +1 -1
- package/dist/module/internal/nativeModuleWeb.js +12 -4
- package/dist/module/internal/nativeModuleWeb.js.map +1 -1
- package/dist/module/internal/registry/app.js +20 -12
- package/dist/module/internal/registry/app.js.map +1 -1
- package/dist/module/internal/registry/modular.js +73 -0
- package/dist/module/internal/registry/modular.js.map +1 -0
- package/dist/module/internal/registry/nativeModule.js +116 -95
- package/dist/module/internal/registry/nativeModule.js.map +1 -1
- package/dist/module/modular.js +44 -37
- package/dist/module/modular.js.map +1 -1
- package/dist/module/types/app.js +0 -3
- package/dist/module/types/app.js.map +1 -1
- package/dist/module/types/internal.js +0 -2
- package/dist/module/utils/UtilsStatics.js +2 -2
- package/dist/module/utils/UtilsStatics.js.map +1 -1
- package/dist/module/utils/index.js +21 -17
- package/dist/module/utils/index.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/FirebaseApp.d.ts +1 -2
- package/dist/typescript/lib/FirebaseApp.d.ts.map +1 -1
- package/dist/typescript/lib/common/index.d.ts +0 -8
- package/dist/typescript/lib/common/index.d.ts.map +1 -1
- package/dist/typescript/lib/common/unitTestUtils.d.ts +1 -4
- package/dist/typescript/lib/common/unitTestUtils.d.ts.map +1 -1
- package/dist/typescript/lib/index.d.ts +0 -1
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/internal/NativeFirebaseError.d.ts +1 -1
- package/dist/typescript/lib/internal/NativeFirebaseError.d.ts.map +1 -1
- package/dist/typescript/lib/internal/RNFBNativeEventEmitter.d.ts.map +1 -1
- package/dist/typescript/lib/internal/constants.d.ts +2 -3
- package/dist/typescript/lib/internal/constants.d.ts.map +1 -1
- package/dist/typescript/lib/internal/index.d.ts +1 -1
- package/dist/typescript/lib/internal/index.d.ts.map +1 -1
- package/dist/typescript/lib/internal/nativeModuleAndroidIos.d.ts +2 -6
- package/dist/typescript/lib/internal/nativeModuleAndroidIos.d.ts.map +1 -1
- package/dist/typescript/lib/internal/nativeModuleWeb.d.ts.map +1 -1
- package/dist/typescript/lib/internal/registry/app.d.ts +2 -2
- package/dist/typescript/lib/internal/registry/app.d.ts.map +1 -1
- package/dist/typescript/lib/internal/registry/modular.d.ts +22 -0
- package/dist/typescript/lib/internal/registry/modular.d.ts.map +1 -0
- package/dist/typescript/lib/internal/registry/nativeModule.d.ts +3 -11
- package/dist/typescript/lib/internal/registry/nativeModule.d.ts.map +1 -1
- package/dist/typescript/lib/modular.d.ts +21 -7
- package/dist/typescript/lib/modular.d.ts.map +1 -1
- package/dist/typescript/lib/types/app.d.ts +4 -4
- package/dist/typescript/lib/types/app.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +1 -33
- package/dist/typescript/lib/types/internal.d.ts.map +1 -1
- package/dist/typescript/lib/utils/index.d.ts +7 -3
- package/dist/typescript/lib/utils/index.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/firebase-schema.json +5 -1
- package/ios/RNFBApp/RNFBAppModule.h +1 -3
- package/ios/RNFBApp/{RNFBAppModule.m → RNFBAppModule.mm} +74 -77
- package/ios/RNFBApp/RNFBUtilsModule.h +1 -3
- package/ios/RNFBApp/{RNFBUtilsModule.m → RNFBUtilsModule.mm} +68 -25
- package/ios/RNFBApp/RNFBVersion.m +1 -1
- package/ios/RNFBApp.xcodeproj/project.pbxproj +12 -12
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModuleProviders.h +16 -0
- package/ios/generated/RCTModuleProviders.mm +52 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RCTUnstableModulesRequiringMainQueueSetupProvider.h +14 -0
- package/ios/generated/RCTUnstableModulesRequiringMainQueueSetupProvider.mm +19 -0
- package/ios/generated/RNFBAppTurboModules/RNFBAppTurboModules-generated.mm +210 -0
- package/ios/generated/RNFBAppTurboModules/RNFBAppTurboModules.h +399 -0
- package/ios/generated/RNFBAppTurboModulesJSI-generated.cpp +187 -0
- package/ios/generated/RNFBAppTurboModulesJSI.h +606 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/ios/generated/ReactCodegen.podspec +111 -0
- package/lib/FirebaseApp.ts +1 -10
- package/lib/common/index.ts +0 -742
- package/lib/common/unitTestUtils.ts +17 -73
- package/lib/index.ts +0 -1
- package/lib/internal/NativeFirebaseError.ts +1 -1
- package/lib/internal/RNFBNativeEventEmitter.ts +12 -6
- package/lib/internal/constants.ts +3 -25
- package/lib/internal/global.d.ts +0 -4
- package/lib/internal/index.ts +1 -1
- package/lib/internal/nativeModuleAndroidIos.ts +69 -12
- package/lib/internal/nativeModuleWeb.ts +11 -5
- package/lib/internal/registry/app.ts +24 -22
- package/lib/internal/registry/modular.ts +97 -0
- package/lib/internal/registry/nativeModule.ts +136 -107
- package/lib/modular.ts +47 -72
- package/lib/types/app.ts +6 -11
- package/lib/types/internal.ts +1 -46
- package/lib/utils/UtilsStatics.ts +2 -2
- package/lib/utils/index.ts +24 -18
- package/lib/version.ts +1 -1
- package/package.json +41 -3
- package/plugin/build/app.plugin.d.ts +2 -0
- package/plugin/build/app.plugin.js +6 -0
- package/plugin/src/app.plugin.ts +3 -0
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/react-native.config.js +2 -0
- package/specs/NativeRNFBTurboApp.ts +57 -0
- package/specs/NativeRNFBTurboUtils.ts +34 -0
- package/typedoc.json +1 -2
- package/dist/module/internal/registry/namespace.js +0 -262
- package/dist/module/internal/registry/namespace.js.map +0 -1
- package/dist/module/namespaced.js +0 -25
- package/dist/module/namespaced.js.map +0 -1
- package/dist/typescript/lib/internal/registry/namespace.d.ts +0 -26
- package/dist/typescript/lib/internal/registry/namespace.d.ts.map +0 -1
- package/dist/typescript/lib/namespaced.d.ts +0 -5
- package/dist/typescript/lib/namespaced.d.ts.map +0 -1
- package/lib/internal/registry/namespace.ts +0 -338
- package/lib/namespaced.ts +0 -24
|
@@ -16,9 +16,12 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
#import <Firebase/Firebase.h>
|
|
19
|
+
#import <React/RCTInvalidating.h>
|
|
19
20
|
#import <React/RCTUtils.h>
|
|
20
21
|
|
|
22
|
+
#import "RCTConvert+FIRApp.h"
|
|
21
23
|
#import "RNFBAppModule.h"
|
|
24
|
+
#import "RNFBAppTurboModules.h"
|
|
22
25
|
#import "RNFBJSON.h"
|
|
23
26
|
#import "RNFBMeta.h"
|
|
24
27
|
#import "RNFBPreferences.h"
|
|
@@ -31,15 +34,19 @@
|
|
|
31
34
|
#define REGISTER_LIB
|
|
32
35
|
#endif
|
|
33
36
|
|
|
37
|
+
@interface RNFBAppModule () <NativeRNFBTurboAppSpec, RCTInvalidating>
|
|
38
|
+
@end
|
|
39
|
+
|
|
34
40
|
@implementation RNFBAppModule
|
|
35
41
|
|
|
36
42
|
#pragma mark -
|
|
37
43
|
#pragma mark Module Setup
|
|
38
44
|
|
|
39
|
-
RCT_EXPORT_MODULE()
|
|
45
|
+
RCT_EXPORT_MODULE(NativeRNFBTurboApp)
|
|
40
46
|
|
|
41
|
-
- (
|
|
42
|
-
|
|
47
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
48
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
49
|
+
return std::make_shared<facebook::react::NativeRNFBTurboAppSpecJSI>(params);
|
|
43
50
|
}
|
|
44
51
|
|
|
45
52
|
- (void)setBridge:(RCTBridge *)bridge {
|
|
@@ -71,54 +78,70 @@ RCT_EXPORT_MODULE();
|
|
|
71
78
|
[[RNFBRCTEventEmitter shared] invalidate];
|
|
72
79
|
}
|
|
73
80
|
|
|
81
|
+
#pragma mark -
|
|
82
|
+
#pragma mark Constants
|
|
83
|
+
|
|
84
|
+
- (NSDictionary *)appConstantsDictionary {
|
|
85
|
+
NSDictionary *firApps = [FIRApp allApps];
|
|
86
|
+
NSMutableArray *appsArray = [NSMutableArray new];
|
|
87
|
+
NSMutableDictionary *constants = [NSMutableDictionary new];
|
|
88
|
+
|
|
89
|
+
for (id key in firApps) {
|
|
90
|
+
[appsArray addObject:[RNFBSharedUtils firAppToDictionary:firApps[key]]];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
constants[@"NATIVE_FIREBASE_APPS"] = appsArray;
|
|
94
|
+
constants[@"FIREBASE_RAW_JSON"] = [[RNFBJSON shared] getRawJSON];
|
|
95
|
+
|
|
96
|
+
return constants;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
- (facebook::react::ModuleConstants<JS::NativeRNFBTurboApp::Constants::Builder>)constantsToExport {
|
|
100
|
+
return [_RCTTypedModuleConstants newWithUnsafeDictionary:[self appConstantsDictionary]];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
- (facebook::react::ModuleConstants<JS::NativeRNFBTurboApp::Constants::Builder>)getConstants {
|
|
104
|
+
return [self constantsToExport];
|
|
105
|
+
}
|
|
106
|
+
|
|
74
107
|
#pragma mark -
|
|
75
108
|
#pragma mark META Methods
|
|
76
109
|
|
|
77
|
-
|
|
78
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
79
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
110
|
+
- (void)metaGetAll:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
80
111
|
resolve([RNFBMeta getAll]);
|
|
81
112
|
}
|
|
82
113
|
|
|
83
114
|
#pragma mark -
|
|
84
115
|
#pragma mark JSON Methods
|
|
85
116
|
|
|
86
|
-
|
|
87
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
88
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
117
|
+
- (void)jsonGetAll:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
89
118
|
resolve([[RNFBJSON shared] getAll]);
|
|
90
119
|
}
|
|
91
120
|
|
|
92
121
|
#pragma mark -
|
|
93
122
|
#pragma mark Preference Methods
|
|
94
123
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
[[RNFBPreferences shared] setBooleanValue:key boolValue:boolValue];
|
|
124
|
+
- (void)preferencesSetBool:(NSString *)key
|
|
125
|
+
value:(BOOL)value
|
|
126
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
127
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
128
|
+
[[RNFBPreferences shared] setBooleanValue:key boolValue:value];
|
|
101
129
|
resolve([NSNull null]);
|
|
102
130
|
}
|
|
103
131
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
[[RNFBPreferences shared] setStringValue:key stringValue:stringValue];
|
|
132
|
+
- (void)preferencesSetString:(NSString *)key
|
|
133
|
+
value:(NSString *)value
|
|
134
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
135
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
136
|
+
[[RNFBPreferences shared] setStringValue:key stringValue:value];
|
|
110
137
|
resolve([NSNull null]);
|
|
111
138
|
}
|
|
112
139
|
|
|
113
|
-
|
|
114
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
115
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
140
|
+
- (void)preferencesGetAll:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
116
141
|
resolve([[RNFBPreferences shared] getAll]);
|
|
117
142
|
}
|
|
118
143
|
|
|
119
|
-
|
|
120
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
121
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
144
|
+
- (void)preferencesClearAll:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
122
145
|
[[RNFBPreferences shared] clearAll];
|
|
123
146
|
resolve([NSNull null]);
|
|
124
147
|
}
|
|
@@ -126,52 +149,48 @@ RCT_EXPORT_METHOD(preferencesClearAll
|
|
|
126
149
|
#pragma mark -
|
|
127
150
|
#pragma mark Event Methods
|
|
128
151
|
|
|
129
|
-
|
|
152
|
+
- (void)eventsNotifyReady:(BOOL)ready {
|
|
130
153
|
[[RNFBRCTEventEmitter shared] notifyJsReady:ready];
|
|
131
154
|
}
|
|
132
155
|
|
|
133
|
-
|
|
134
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
135
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
156
|
+
- (void)eventsGetListeners:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
136
157
|
resolve([[RNFBRCTEventEmitter shared] getListenersDictionary]);
|
|
137
158
|
}
|
|
138
159
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
160
|
+
- (void)eventsPing:(NSString *)eventName
|
|
161
|
+
eventBody:(NSDictionary *)eventBody
|
|
162
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
163
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
144
164
|
[[RNFBRCTEventEmitter shared] sendEventWithName:eventName body:eventBody];
|
|
145
165
|
resolve(eventBody);
|
|
146
166
|
}
|
|
147
167
|
|
|
148
|
-
|
|
168
|
+
- (void)eventsAddListener:(NSString *)eventName {
|
|
149
169
|
[[RNFBRCTEventEmitter shared] addListener:eventName];
|
|
150
170
|
}
|
|
151
171
|
|
|
152
|
-
|
|
172
|
+
- (void)eventsRemoveListener:(NSString *)eventName all:(BOOL)all {
|
|
153
173
|
[[RNFBRCTEventEmitter shared] removeListeners:eventName all:all];
|
|
154
174
|
}
|
|
155
175
|
|
|
156
176
|
#pragma mark -
|
|
157
177
|
#pragma mark Events Unused
|
|
158
178
|
|
|
159
|
-
|
|
179
|
+
- (void)addListener:(NSString *)eventName {
|
|
160
180
|
// Keep: Required for RN built in Event Emitter Calls.
|
|
161
181
|
}
|
|
162
182
|
|
|
163
|
-
|
|
183
|
+
- (void)removeListeners:(double)count {
|
|
164
184
|
// Keep: Required for RN built in Event Emitter Calls.
|
|
165
185
|
}
|
|
166
186
|
|
|
167
187
|
#pragma mark -
|
|
168
188
|
#pragma mark Firebase App Methods
|
|
169
189
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
190
|
+
- (void)initializeApp:(NSDictionary *)options
|
|
191
|
+
appConfig:(NSDictionary *)appConfig
|
|
192
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
193
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
175
194
|
RCTUnsafeExecuteOnMainQueueSync(^{
|
|
176
195
|
FIRApp *firApp;
|
|
177
196
|
NSString *appName = [appConfig valueForKey:@"name"];
|
|
@@ -182,24 +201,18 @@ RCT_EXPORT_METHOD(initializeApp
|
|
|
182
201
|
GCMSenderID:messagingSenderId];
|
|
183
202
|
firOptions.APIKey = [options valueForKey:@"apiKey"];
|
|
184
203
|
firOptions.projectID = [options valueForKey:@"projectId"];
|
|
185
|
-
// kFirebaseOptionsDatabaseUrl
|
|
186
204
|
if (![[options valueForKey:@"databaseURL"] isEqual:[NSNull null]]) {
|
|
187
205
|
firOptions.databaseURL = [options valueForKey:@"databaseURL"];
|
|
188
206
|
}
|
|
189
|
-
// kFirebaseOptionsStorageBucket
|
|
190
207
|
if (![[options valueForKey:@"storageBucket"] isEqual:[NSNull null]]) {
|
|
191
208
|
firOptions.storageBucket = [options valueForKey:@"storageBucket"];
|
|
192
209
|
}
|
|
193
|
-
|
|
194
|
-
// kFirebaseOptionsIosBundleId
|
|
195
210
|
if (![[options valueForKey:@"iosBundleId"] isEqual:[NSNull null]]) {
|
|
196
211
|
firOptions.bundleID = [options valueForKey:@"iosBundleId"];
|
|
197
212
|
}
|
|
198
|
-
// kFirebaseOptionsIosClientId
|
|
199
213
|
if (![[options valueForKey:@"iosClientId"] isEqual:[NSNull null]]) {
|
|
200
214
|
firOptions.clientID = [options valueForKey:@"iosClientId"];
|
|
201
215
|
}
|
|
202
|
-
// kFirebaseOptionsAppGroupId
|
|
203
216
|
if (![[options valueForKey:@"appGroupId"] isEqual:[NSNull null]]) {
|
|
204
217
|
firOptions.appGroupID = [options valueForKey:@"appGroupId"];
|
|
205
218
|
}
|
|
@@ -237,7 +250,7 @@ static NSMutableDictionary<NSString *, NSString *> *customAuthDomains;
|
|
|
237
250
|
return customAuthDomains[appName];
|
|
238
251
|
}
|
|
239
252
|
|
|
240
|
-
|
|
253
|
+
- (void)setLogLevel:(NSString *)logLevel {
|
|
241
254
|
int level = FIRLoggerLevelError;
|
|
242
255
|
if ([logLevel isEqualToString:@"verbose"]) {
|
|
243
256
|
level = FIRLoggerLevelDebug;
|
|
@@ -249,19 +262,20 @@ RCT_EXPORT_METHOD(setLogLevel : (NSString *)logLevel) {
|
|
|
249
262
|
level = FIRLoggerLevelWarning;
|
|
250
263
|
}
|
|
251
264
|
DLog(@"RNFBSetLogLevel: setting level to %d from %@.", level, logLevel);
|
|
252
|
-
[[FIRConfiguration sharedInstance] setLoggerLevel:level];
|
|
265
|
+
[[FIRConfiguration sharedInstance] setLoggerLevel:(FIRLoggerLevel)level];
|
|
253
266
|
}
|
|
254
267
|
|
|
255
|
-
|
|
268
|
+
- (void)setAutomaticDataCollectionEnabled:(NSString *)appName enabled:(BOOL)enabled {
|
|
269
|
+
FIRApp *firApp = [RCTConvert firAppFromString:appName];
|
|
256
270
|
if (firApp) {
|
|
257
271
|
firApp.dataCollectionDefaultEnabled = enabled;
|
|
258
272
|
}
|
|
259
273
|
}
|
|
260
274
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
275
|
+
- (void)deleteApp:(NSString *)appName
|
|
276
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
277
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
278
|
+
FIRApp *firApp = [RCTConvert firAppFromString:appName];
|
|
265
279
|
if (!firApp) {
|
|
266
280
|
return resolve([NSNull null]);
|
|
267
281
|
}
|
|
@@ -270,12 +284,10 @@ RCT_EXPORT_METHOD(deleteApp
|
|
|
270
284
|
if (success) {
|
|
271
285
|
resolve([NSNull null]);
|
|
272
286
|
} else {
|
|
273
|
-
// try again once more
|
|
274
287
|
[firApp deleteApp:^(BOOL success2) {
|
|
275
288
|
if (success2) {
|
|
276
289
|
resolve([NSNull null]);
|
|
277
290
|
} else {
|
|
278
|
-
// TODO js error builder
|
|
279
291
|
reject(@"app/delete-app-failed", @"Failed to delete the specified app.", nil);
|
|
280
292
|
}
|
|
281
293
|
}];
|
|
@@ -283,23 +295,8 @@ RCT_EXPORT_METHOD(deleteApp
|
|
|
283
295
|
}];
|
|
284
296
|
}
|
|
285
297
|
|
|
286
|
-
- (NSDictionary *)constantsToExport {
|
|
287
|
-
NSDictionary *firApps = [FIRApp allApps];
|
|
288
|
-
NSMutableArray *appsArray = [NSMutableArray new];
|
|
289
|
-
NSMutableDictionary *constants = [NSMutableDictionary new];
|
|
290
|
-
|
|
291
|
-
for (id key in firApps) {
|
|
292
|
-
[appsArray addObject:[RNFBSharedUtils firAppToDictionary:firApps[key]]];
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
constants[@"NATIVE_FIREBASE_APPS"] = appsArray;
|
|
296
|
-
|
|
297
|
-
constants[@"FIREBASE_RAW_JSON"] = [[RNFBJSON shared] getRawJSON];
|
|
298
|
-
|
|
299
|
-
return constants;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
298
|
+ (BOOL)requiresMainQueueSetup {
|
|
303
|
-
return
|
|
299
|
+
return NO;
|
|
304
300
|
}
|
|
301
|
+
|
|
305
302
|
@end
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
#import <Foundation/Foundation.h>
|
|
19
19
|
#import <Photos/Photos.h>
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@interface RNFBUtilsModule : NSObject <RCTBridgeModule>
|
|
21
|
+
@interface RNFBUtilsModule : NSObject
|
|
24
22
|
|
|
25
23
|
+ (BOOL)isRemoteAsset:(NSString *)localFilePath;
|
|
26
24
|
+ (BOOL)unused_isHeic:(NSString *)localFilePath;
|
|
@@ -18,20 +18,84 @@
|
|
|
18
18
|
#import <React/RCTUtils.h>
|
|
19
19
|
|
|
20
20
|
#import "RNFBApp/RNFBSharedUtils.h"
|
|
21
|
+
#import "RNFBAppTurboModules.h"
|
|
21
22
|
#import "RNFBUtilsModule.h"
|
|
22
23
|
|
|
24
|
+
@interface RNFBUtilsModule () <NativeRNFBTurboUtilsSpec>
|
|
25
|
+
@end
|
|
26
|
+
|
|
23
27
|
@implementation RNFBUtilsModule
|
|
24
28
|
#pragma mark -
|
|
25
29
|
#pragma mark Module Setup
|
|
26
30
|
|
|
27
|
-
RCT_EXPORT_MODULE()
|
|
31
|
+
RCT_EXPORT_MODULE(NativeRNFBTurboUtils)
|
|
28
32
|
|
|
29
|
-
- (
|
|
30
|
-
|
|
33
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
34
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
35
|
+
return std::make_shared<facebook::react::NativeRNFBTurboUtilsSpecJSI>(params);
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
+ (BOOL)requiresMainQueueSetup {
|
|
34
|
-
return
|
|
39
|
+
return NO;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#pragma mark -
|
|
43
|
+
#pragma mark Constants
|
|
44
|
+
|
|
45
|
+
- (NSString *)getPathForDirectory:(int)directory {
|
|
46
|
+
NSArray *paths =
|
|
47
|
+
NSSearchPathForDirectoriesInDomains((NSSearchPathDirectory)directory, NSUserDomainMask, YES);
|
|
48
|
+
return [paths firstObject];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
- (NSDictionary *)utilsConstantsDictionary {
|
|
52
|
+
return @{
|
|
53
|
+
@"isRunningInTestLab" : @NO,
|
|
54
|
+
@"MAIN_BUNDLE" : [[NSBundle mainBundle] bundlePath],
|
|
55
|
+
@"CACHES_DIRECTORY" : [self getPathForDirectory:NSCachesDirectory],
|
|
56
|
+
@"DOCUMENT_DIRECTORY" : [self getPathForDirectory:NSDocumentDirectory],
|
|
57
|
+
@"PICTURES_DIRECTORY" : [self getPathForDirectory:NSPicturesDirectory],
|
|
58
|
+
@"MOVIES_DIRECTORY" : [self getPathForDirectory:NSMoviesDirectory],
|
|
59
|
+
@"TEMP_DIRECTORY" : NSTemporaryDirectory(),
|
|
60
|
+
@"LIBRARY_DIRECTORY" : [self getPathForDirectory:NSLibraryDirectory],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
- (facebook::react::ModuleConstants<JS::NativeRNFBTurboUtils::Constants::Builder>)
|
|
65
|
+
constantsToExport {
|
|
66
|
+
return [_RCTTypedModuleConstants newWithUnsafeDictionary:[self utilsConstantsDictionary]];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
- (facebook::react::ModuleConstants<JS::NativeRNFBTurboUtils::Constants::Builder>)getConstants {
|
|
70
|
+
return [self constantsToExport];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
#pragma mark -
|
|
74
|
+
#pragma mark Android-only stubs
|
|
75
|
+
|
|
76
|
+
- (void)androidGetPlayServicesStatus:(RCTPromiseResolveBlock)resolve
|
|
77
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
78
|
+
resolve(@{
|
|
79
|
+
@"isAvailable" : @YES,
|
|
80
|
+
@"status" : @0,
|
|
81
|
+
@"hasResolution" : @NO,
|
|
82
|
+
@"isUserResolvableError" : @NO,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
- (void)androidPromptForPlayServices:(RCTPromiseResolveBlock)resolve
|
|
87
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
88
|
+
resolve(nil);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
- (void)androidResolutionForPlayServices:(RCTPromiseResolveBlock)resolve
|
|
92
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
93
|
+
resolve(nil);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
- (void)androidMakePlayServicesAvailable:(RCTPromiseResolveBlock)resolve
|
|
97
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
98
|
+
resolve(nil);
|
|
35
99
|
}
|
|
36
100
|
|
|
37
101
|
#pragma mark -
|
|
@@ -56,7 +120,6 @@ RCT_EXPORT_MODULE();
|
|
|
56
120
|
|
|
57
121
|
if ([localFilePath hasPrefix:@"assets-library://"] || [localFilePath hasPrefix:@"ph://"]) {
|
|
58
122
|
if ([localFilePath hasPrefix:@"assets-library://"]) {
|
|
59
|
-
NSURL *localFile = [[NSURL alloc] initWithString:localFilePath];
|
|
60
123
|
static BOOL hasWarned = NO;
|
|
61
124
|
if (!hasWarned) {
|
|
62
125
|
NSLog(@"'assets-library://' & 'ph://' URLs are not supported in Catalyst-based targets "
|
|
@@ -77,24 +140,4 @@ RCT_EXPORT_MODULE();
|
|
|
77
140
|
return asset;
|
|
78
141
|
}
|
|
79
142
|
|
|
80
|
-
- (NSString *)getPathForDirectory:(int)directory {
|
|
81
|
-
NSArray *paths =
|
|
82
|
-
NSSearchPathForDirectoriesInDomains((NSSearchPathDirectory)directory, NSUserDomainMask, YES);
|
|
83
|
-
return [paths firstObject];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
- (NSDictionary *)constantsToExport {
|
|
87
|
-
NSMutableDictionary *constants = [@{
|
|
88
|
-
@"MAIN_BUNDLE" : [[NSBundle mainBundle] bundlePath],
|
|
89
|
-
@"CACHES_DIRECTORY" : [self getPathForDirectory:NSCachesDirectory],
|
|
90
|
-
@"DOCUMENT_DIRECTORY" : [self getPathForDirectory:NSDocumentDirectory],
|
|
91
|
-
@"PICTURES_DIRECTORY" : [self getPathForDirectory:NSPicturesDirectory],
|
|
92
|
-
@"MOVIES_DIRECTORY" : [self getPathForDirectory:NSMoviesDirectory],
|
|
93
|
-
@"TEMP_DIRECTORY" : NSTemporaryDirectory(),
|
|
94
|
-
@"LIBRARY_DIRECTORY" : [self getPathForDirectory:NSLibraryDirectory],
|
|
95
|
-
} mutableCopy];
|
|
96
|
-
|
|
97
|
-
return constants;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
143
|
@end
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
objects = {
|
|
8
8
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
|
-
2744B98621F45429004F8E3F /* RNFBAppModule.
|
|
10
|
+
2744B98621F45429004F8E3F /* RNFBAppModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744B98521F45429004F8E3F /* RNFBAppModule.mm */; };
|
|
11
11
|
2744B99121F46140004F8E3F /* RNFBRCTEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744B99021F46140004F8E3F /* RNFBRCTEventEmitter.m */; };
|
|
12
12
|
2744B9A421F48A4F004F8E3F /* RCTConvert+FIROptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744B9A321F48A4F004F8E3F /* RCTConvert+FIROptions.m */; };
|
|
13
13
|
2744B9A721F57C2F004F8E3F /* RCTConvert+FIRApp.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744B9A621F57C2F004F8E3F /* RCTConvert+FIRApp.m */; };
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
2748D8172236429D00FC8DC8 /* RNFBSharedUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 2748D8102236417700FC8DC8 /* RNFBSharedUtils.m */; };
|
|
16
16
|
2748D81C223674CD00FC8DC8 /* RNFBPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 2748D81B223674CD00FC8DC8 /* RNFBPreferences.m */; };
|
|
17
17
|
2748D8202237018600FC8DC8 /* RNFBMeta.m in Sources */ = {isa = PBXBuildFile; fileRef = 2748D81F2237018600FC8DC8 /* RNFBMeta.m */; };
|
|
18
|
-
4D97BAD423042F2700077358 /* RNFBUtilsModule.
|
|
18
|
+
4D97BAD423042F2700077358 /* RNFBUtilsModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4D97BAD323042F2700077358 /* RNFBUtilsModule.mm */; };
|
|
19
19
|
DAA1F28522FCF6AD00F4DEC1 /* RNFBVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = DAA1F28422FCF6AD00F4DEC1 /* RNFBVersion.m */; };
|
|
20
20
|
RNFB00001A2025011100000001 /* RNFBNullSentinelInterceptor.m in Sources */ = {isa = PBXBuildFile; fileRef = RNFB00001A2025011100000002 /* RNFBNullSentinelInterceptor.m */; };
|
|
21
21
|
/* End PBXBuildFile section */
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
/* Begin PBXFileReference section */
|
|
36
36
|
2744B98221F45429004F8E3F /* libRNFBApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFBApp.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
37
37
|
2744B98421F45429004F8E3F /* RNFBAppModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBAppModule.h; path = RNFBApp/RNFBAppModule.h; sourceTree = SOURCE_ROOT; };
|
|
38
|
-
2744B98521F45429004F8E3F /* RNFBAppModule.
|
|
38
|
+
2744B98521F45429004F8E3F /* RNFBAppModule.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = RNFBAppModule.mm; path = RNFBApp/RNFBAppModule.mm; sourceTree = SOURCE_ROOT; };
|
|
39
39
|
2744B98D21F45E8B004F8E3F /* RNFBRCTEventEmitter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBRCTEventEmitter.h; sourceTree = "<group>"; };
|
|
40
40
|
2744B99021F46140004F8E3F /* RNFBRCTEventEmitter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBRCTEventEmitter.m; sourceTree = "<group>"; };
|
|
41
41
|
2744B9A221F48826004F8E3F /* RCTConvert+FIROptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+FIROptions.h"; sourceTree = "<group>"; };
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
2748D81E2237012B00FC8DC8 /* RNFBMeta.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBMeta.h; sourceTree = "<group>"; };
|
|
52
52
|
2748D81F2237018600FC8DC8 /* RNFBMeta.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBMeta.m; sourceTree = "<group>"; };
|
|
53
53
|
4D97BAD223042F0800077358 /* RNFBUtilsModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBUtilsModule.h; sourceTree = "<group>"; };
|
|
54
|
-
4D97BAD323042F2700077358 /* RNFBUtilsModule.
|
|
54
|
+
4D97BAD323042F2700077358 /* RNFBUtilsModule.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RNFBUtilsModule.mm; sourceTree = "<group>"; };
|
|
55
55
|
DAA1F28422FCF6AD00F4DEC1 /* RNFBVersion.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBVersion.m; sourceTree = "<group>"; };
|
|
56
56
|
DAA1F28622FCF6C200F4DEC1 /* RNFBVersion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBVersion.h; sourceTree = "<group>"; };
|
|
57
57
|
RNFB00001A2025011100000002 /* RNFBNullSentinelInterceptor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBNullSentinelInterceptor.m; sourceTree = "<group>"; };
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
2744B9A521F57BD9004F8E3F /* RCTConvert+FIRApp.h */,
|
|
92
92
|
2744B9A621F57C2F004F8E3F /* RCTConvert+FIRApp.m */,
|
|
93
93
|
2744B98421F45429004F8E3F /* RNFBAppModule.h */,
|
|
94
|
-
2744B98521F45429004F8E3F /* RNFBAppModule.
|
|
94
|
+
2744B98521F45429004F8E3F /* RNFBAppModule.mm */,
|
|
95
95
|
2748D8162236428100FC8DC8 /* RNFBJSON.h */,
|
|
96
96
|
2748D8142236426300FC8DC8 /* RNFBJSON.m */,
|
|
97
97
|
2748D81A223674B600FC8DC8 /* RNFBPreferences.h */,
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
DAA1F28422FCF6AD00F4DEC1 /* RNFBVersion.m */,
|
|
100
100
|
DAA1F28622FCF6C200F4DEC1 /* RNFBVersion.h */,
|
|
101
101
|
4D97BAD223042F0800077358 /* RNFBUtilsModule.h */,
|
|
102
|
-
4D97BAD323042F2700077358 /* RNFBUtilsModule.
|
|
102
|
+
4D97BAD323042F2700077358 /* RNFBUtilsModule.mm */,
|
|
103
103
|
RNFB00001A2025011100000003 /* RNFBNullSentinelInterceptor.h */,
|
|
104
104
|
RNFB00001A2025011100000002 /* RNFBNullSentinelInterceptor.m */,
|
|
105
105
|
);
|
|
@@ -173,12 +173,12 @@
|
|
|
173
173
|
isa = PBXSourcesBuildPhase;
|
|
174
174
|
buildActionMask = 2147483647;
|
|
175
175
|
files = (
|
|
176
|
-
2744B98621F45429004F8E3F /* RNFBAppModule.
|
|
176
|
+
2744B98621F45429004F8E3F /* RNFBAppModule.mm in Sources */,
|
|
177
177
|
2744B9A721F57C2F004F8E3F /* RCTConvert+FIRApp.m in Sources */,
|
|
178
178
|
2748D8172236429D00FC8DC8 /* RNFBSharedUtils.m in Sources */,
|
|
179
179
|
2748D81C223674CD00FC8DC8 /* RNFBPreferences.m in Sources */,
|
|
180
180
|
DAA1F28522FCF6AD00F4DEC1 /* RNFBVersion.m in Sources */,
|
|
181
|
-
4D97BAD423042F2700077358 /* RNFBUtilsModule.
|
|
181
|
+
4D97BAD423042F2700077358 /* RNFBUtilsModule.mm in Sources */,
|
|
182
182
|
2748D8202237018600FC8DC8 /* RNFBMeta.m in Sources */,
|
|
183
183
|
2744B99121F46140004F8E3F /* RNFBRCTEventEmitter.m in Sources */,
|
|
184
184
|
2744B9A421F48A4F004F8E3F /* RCTConvert+FIROptions.m in Sources */,
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
);
|
|
219
219
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
220
220
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
221
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
221
|
+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
|
222
222
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
|
223
223
|
MTL_FAST_MATH = YES;
|
|
224
224
|
OTHER_LDFLAGS = "-ObjC";
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
|
253
253
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
254
254
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
255
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
255
|
+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
|
256
256
|
MTL_ENABLE_DEBUG_INFO = NO;
|
|
257
257
|
MTL_FAST_MATH = YES;
|
|
258
258
|
OTHER_LDFLAGS = "-ObjC";
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
"${SRCROOT}/../../../tests/ios/Pods/Headers/Public/**",
|
|
311
311
|
"$(SRCROOT)/../../../node_modules/react-native/React/**",
|
|
312
312
|
);
|
|
313
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
313
|
+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
|
314
314
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
315
315
|
MACH_O_TYPE = staticlib;
|
|
316
316
|
OTHER_LDFLAGS = "$(inherited)";
|
|
@@ -374,7 +374,7 @@
|
|
|
374
374
|
"${SRCROOT}/../../../ios/Pods/Headers/Public/**",
|
|
375
375
|
"$(SRCROOT)/../../../node_modules/react-native/React/**",
|
|
376
376
|
);
|
|
377
|
-
IPHONEOS_DEPLOYMENT_TARGET =
|
|
377
|
+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
|
378
378
|
LIBRARY_SEARCH_PATHS = "$(inherited)";
|
|
379
379
|
MACH_O_TYPE = staticlib;
|
|
380
380
|
ONLY_ACTIVE_ARCH = YES;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
#if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
|
|
12
|
+
#import <React-RCTAppDelegate/RCTDependencyProvider.h>
|
|
13
|
+
#elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
|
|
14
|
+
#import <React_RCTAppDelegate/RCTDependencyProvider.h>
|
|
15
|
+
#else
|
|
16
|
+
#import "RCTDependencyProvider.h"
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
20
|
+
|
|
21
|
+
@interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
|
|
22
|
+
|
|
23
|
+
@end
|
|
24
|
+
|
|
25
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTAppDependencyProvider.h"
|
|
9
|
+
#import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
|
|
10
|
+
#import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
|
|
11
|
+
|
|
12
|
+
@implementation RCTAppDependencyProvider {
|
|
13
|
+
NSArray<NSString *> * _URLRequestHandlerClassNames;
|
|
14
|
+
NSArray<NSString *> * _imageDataDecoderClassNames;
|
|
15
|
+
NSArray<NSString *> * _imageURLLoaderClassNames;
|
|
16
|
+
NSDictionary<NSString *,Class<RCTComponentViewProtocol>> * _thirdPartyFabricComponents;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
- (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
|
|
20
|
+
static dispatch_once_t requestUrlToken;
|
|
21
|
+
dispatch_once(&requestUrlToken, ^{
|
|
22
|
+
self->_URLRequestHandlerClassNames = RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return _URLRequestHandlerClassNames;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
- (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
|
|
29
|
+
static dispatch_once_t dataDecoderToken;
|
|
30
|
+
dispatch_once(&dataDecoderToken, ^{
|
|
31
|
+
_imageDataDecoderClassNames = RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return _imageDataDecoderClassNames;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
|
|
38
|
+
static dispatch_once_t urlLoaderToken;
|
|
39
|
+
dispatch_once(&urlLoaderToken, ^{
|
|
40
|
+
_imageURLLoaderClassNames = RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return _imageURLLoaderClassNames;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
|
|
47
|
+
static dispatch_once_t nativeComponentsToken;
|
|
48
|
+
dispatch_once(&nativeComponentsToken, ^{
|
|
49
|
+
_thirdPartyFabricComponents = RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return _thirdPartyFabricComponents;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@protocol RCTModuleProvider;
|
|
11
|
+
|
|
12
|
+
@interface RCTModuleProviders: NSObject
|
|
13
|
+
|
|
14
|
+
+ (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders;
|
|
15
|
+
|
|
16
|
+
@end
|