@react-native-firebase/database 25.0.1 → 26.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/RNFBDatabase.podspec +18 -6
  3. package/android/build.gradle +19 -0
  4. package/android/src/main/java/io/invertase/firebase/database/UniversalFirebaseDatabaseModule.java +4 -14
  5. package/android/src/reactnative/java/io/invertase/firebase/database/DatabaseTurboModuleSupport.java +56 -0
  6. package/android/src/reactnative/java/io/invertase/firebase/database/{ReactNativeFirebaseDatabaseModule.java → NativeRNFBTurboDatabase.java} +16 -36
  7. package/android/src/reactnative/java/io/invertase/firebase/database/{ReactNativeFirebaseDatabaseOnDisconnectModule.java → NativeRNFBTurboDatabaseOnDisconnect.java} +19 -14
  8. package/android/src/reactnative/java/io/invertase/firebase/database/{ReactNativeFirebaseDatabaseQueryModule.java → NativeRNFBTurboDatabaseQuery.java} +41 -105
  9. package/android/src/reactnative/java/io/invertase/firebase/database/{ReactNativeFirebaseDatabaseReferenceModule.java → NativeRNFBTurboDatabaseReference.java} +27 -20
  10. package/android/src/reactnative/java/io/invertase/firebase/database/{ReactNativeFirebaseDatabaseTransactionModule.java → NativeRNFBTurboDatabaseTransaction.java} +41 -19
  11. package/android/src/reactnative/java/io/invertase/firebase/database/ReactNativeFirebaseDatabasePackage.java +5 -5
  12. package/android/src/reactnative/java/io/invertase/firebase/database/ReactNativeFirebaseDatabaseTransactionHandler.java +11 -0
  13. package/android/src/reactnative/java/io/invertase/firebase/database/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboDatabaseOnDisconnectSpec.java +55 -0
  14. package/android/src/reactnative/java/io/invertase/firebase/database/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboDatabaseQuerySpec.java +52 -0
  15. package/android/src/reactnative/java/io/invertase/firebase/database/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboDatabaseReferenceSpec.java +55 -0
  16. package/android/src/reactnative/java/io/invertase/firebase/database/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboDatabaseSpec.java +57 -0
  17. package/android/src/reactnative/java/io/invertase/firebase/database/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboDatabaseTransactionSpec.java +42 -0
  18. package/android/src/reactnative/java/io/invertase/firebase/database/generated/jni/CMakeLists.txt +36 -0
  19. package/android/src/reactnative/java/io/invertase/firebase/database/generated/jni/RNFBDatabaseTurboModules-generated.cpp +182 -0
  20. package/android/src/reactnative/java/io/invertase/firebase/database/generated/jni/RNFBDatabaseTurboModules.h +63 -0
  21. package/android/src/reactnative/java/io/invertase/firebase/database/generated/jni/react/renderer/components/RNFBDatabaseTurboModules/RNFBDatabaseTurboModulesJSI-generated.cpp +257 -0
  22. package/android/src/reactnative/java/io/invertase/firebase/database/generated/jni/react/renderer/components/RNFBDatabaseTurboModules/RNFBDatabaseTurboModulesJSI.h +440 -0
  23. package/dist/module/DatabaseDataSnapshot.js +20 -6
  24. package/dist/module/DatabaseDataSnapshot.js.map +1 -1
  25. package/dist/module/DatabaseOnDisconnect.js.map +1 -1
  26. package/dist/module/DatabaseQuery.js +13 -16
  27. package/dist/module/DatabaseQuery.js.map +1 -1
  28. package/dist/module/DatabaseReference.js +16 -15
  29. package/dist/module/DatabaseReference.js.map +1 -1
  30. package/dist/module/DatabaseSyncTree.js +5 -4
  31. package/dist/module/DatabaseSyncTree.js.map +1 -1
  32. package/dist/module/DatabaseThenableReference.js +1 -2
  33. package/dist/module/DatabaseThenableReference.js.map +1 -1
  34. package/dist/module/index.js +210 -5
  35. package/dist/module/index.js.map +1 -1
  36. package/dist/module/modular/query.js +14 -15
  37. package/dist/module/modular/query.js.map +1 -1
  38. package/dist/module/modular/transaction.js +1 -2
  39. package/dist/module/modular/transaction.js.map +1 -1
  40. package/dist/module/version.js +1 -1
  41. package/dist/module/web/RNFBDatabaseModule.js +4 -8
  42. package/dist/module/web/RNFBDatabaseModule.js.map +1 -1
  43. package/dist/typescript/lib/DatabaseDataSnapshot.d.ts +9 -7
  44. package/dist/typescript/lib/DatabaseDataSnapshot.d.ts.map +1 -1
  45. package/dist/typescript/lib/DatabaseOnDisconnect.d.ts +3 -3
  46. package/dist/typescript/lib/DatabaseOnDisconnect.d.ts.map +1 -1
  47. package/dist/typescript/lib/DatabaseQuery.d.ts +18 -18
  48. package/dist/typescript/lib/DatabaseQuery.d.ts.map +1 -1
  49. package/dist/typescript/lib/DatabaseReference.d.ts +8 -8
  50. package/dist/typescript/lib/DatabaseReference.d.ts.map +1 -1
  51. package/dist/typescript/lib/DatabaseSyncTree.d.ts +2 -2
  52. package/dist/typescript/lib/DatabaseSyncTree.d.ts.map +1 -1
  53. package/dist/typescript/lib/DatabaseThenableReference.d.ts +8 -8
  54. package/dist/typescript/lib/DatabaseThenableReference.d.ts.map +1 -1
  55. package/dist/typescript/lib/index.d.ts +57 -4
  56. package/dist/typescript/lib/index.d.ts.map +1 -1
  57. package/dist/typescript/lib/modular/query.d.ts.map +1 -1
  58. package/dist/typescript/lib/modular/transaction.d.ts.map +1 -1
  59. package/dist/typescript/lib/types/database.d.ts +5 -5
  60. package/dist/typescript/lib/types/database.d.ts.map +1 -1
  61. package/dist/typescript/lib/types/internal.d.ts +32 -31
  62. package/dist/typescript/lib/types/internal.d.ts.map +1 -1
  63. package/dist/typescript/lib/version.d.ts +1 -1
  64. package/dist/typescript/lib/web/RNFBDatabaseModule.d.ts.map +1 -1
  65. package/ios/RNFBDatabase/{RNFBDatabaseModule.m → RNFBDatabaseModule.mm} +32 -32
  66. package/ios/RNFBDatabase/{RNFBDatabaseOnDisconnectModule.m → RNFBDatabaseOnDisconnectModule.mm} +49 -34
  67. package/ios/RNFBDatabase/{RNFBDatabaseQueryModule.m → RNFBDatabaseQueryModule.mm} +35 -28
  68. package/ios/RNFBDatabase/{RNFBDatabaseReferenceModule.m → RNFBDatabaseReferenceModule.mm} +56 -35
  69. package/ios/RNFBDatabase/{RNFBDatabaseTransactionModule.m → RNFBDatabaseTransactionModule.mm} +50 -26
  70. package/ios/RNFBDatabase.xcodeproj/project.pbxproj +24 -24
  71. package/ios/generated/RCTAppDependencyProvider.h +25 -0
  72. package/ios/generated/RCTAppDependencyProvider.mm +55 -0
  73. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  74. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  75. package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
  76. package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
  77. package/ios/generated/RNFBDatabaseTurboModules/RNFBDatabaseTurboModules-generated.mm +254 -0
  78. package/ios/generated/RNFBDatabaseTurboModules/RNFBDatabaseTurboModules.h +264 -0
  79. package/ios/generated/RNFBDatabaseTurboModulesJSI-generated.cpp +257 -0
  80. package/ios/generated/RNFBDatabaseTurboModulesJSI.h +440 -0
  81. package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
  82. package/lib/DatabaseDataSnapshot.ts +43 -38
  83. package/lib/DatabaseOnDisconnect.ts +3 -3
  84. package/lib/DatabaseQuery.ts +45 -77
  85. package/lib/DatabaseReference.ts +37 -66
  86. package/lib/DatabaseSyncTree.ts +8 -11
  87. package/lib/DatabaseThenableReference.ts +9 -17
  88. package/lib/index.ts +325 -6
  89. package/lib/modular/query.ts +14 -70
  90. package/lib/modular/transaction.ts +1 -4
  91. package/lib/types/database.ts +5 -5
  92. package/lib/types/internal.ts +31 -56
  93. package/lib/version.ts +1 -1
  94. package/lib/web/RNFBDatabaseModule.ts +6 -10
  95. package/package.json +26 -4
  96. package/react-native.config.js +10 -0
  97. package/specs/NativeRNFBTurboDatabase.ts +13 -0
  98. package/specs/NativeRNFBTurboDatabaseOnDisconnect.ts +18 -0
  99. package/specs/NativeRNFBTurboDatabaseQuery.ts +25 -0
  100. package/specs/NativeRNFBTurboDatabaseReference.ts +13 -0
  101. package/specs/NativeRNFBTurboDatabaseTransaction.ts +16 -0
  102. package/typedoc.json +1 -1
  103. package/dist/module/modular.js +0 -76
  104. package/dist/module/modular.js.map +0 -1
  105. package/dist/module/namespaced.js +0 -147
  106. package/dist/module/namespaced.js.map +0 -1
  107. package/dist/module/types/namespaced.js +0 -67
  108. package/dist/module/types/namespaced.js.map +0 -1
  109. package/dist/typescript/lib/modular.d.ts +0 -24
  110. package/dist/typescript/lib/modular.d.ts.map +0 -1
  111. package/dist/typescript/lib/namespaced.d.ts +0 -13
  112. package/dist/typescript/lib/namespaced.d.ts.map +0 -1
  113. package/dist/typescript/lib/types/namespaced.d.ts +0 -1230
  114. package/dist/typescript/lib/types/namespaced.d.ts.map +0 -1
  115. package/lib/modular.ts +0 -134
  116. package/lib/namespaced.ts +0 -253
  117. package/lib/types/namespaced.ts +0 -1366
@@ -18,29 +18,50 @@
18
18
  #import <Firebase/Firebase.h>
19
19
  #import <React/RCTUtils.h>
20
20
 
21
+ #import "RNFBApp/RCTConvert+FIRApp.h"
21
22
  #import "RNFBDatabaseCommon.h"
22
23
  #import "RNFBDatabaseReferenceModule.h"
24
+ #import "RNFBDatabaseTurboModules.h"
25
+
26
+ @interface RNFBDatabaseReferenceModule () <NativeRNFBTurboDatabaseReferenceSpec, RCTBridgeModule>
27
+ @end
23
28
 
24
29
  @implementation RNFBDatabaseReferenceModule
25
30
  #pragma mark -
26
31
  #pragma mark Module Setup
27
32
 
28
- RCT_EXPORT_MODULE();
33
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
34
+ (const facebook::react::ObjCTurboModule::InitParams &)params {
35
+ return std::make_shared<facebook::react::NativeRNFBTurboDatabaseReferenceSpecJSI>(params);
36
+ }
37
+
38
+ RCT_EXPORT_MODULE(NativeRNFBTurboDatabaseReference);
39
+
40
+ + (BOOL)requiresMainQueueSetup {
41
+ return NO;
42
+ }
29
43
 
30
44
  - (dispatch_queue_t)methodQueue {
31
45
  return [RNFBDatabaseCommon getDispatchQueue];
32
46
  }
33
47
 
48
+ - (void)dealloc {
49
+ [self invalidate];
50
+ }
51
+
52
+ - (void)invalidate {
53
+ }
54
+
34
55
  #pragma mark -
35
56
  #pragma mark Firebase Database
36
57
 
37
- RCT_EXPORT_METHOD(set
38
- : (FIRApp *)firebaseApp
39
- : (NSString *)dbURL
40
- : (NSString *)path
41
- : (NSDictionary *)props
42
- : (RCTPromiseResolveBlock)resolve
43
- : (RCTPromiseRejectBlock)reject) {
58
+ - (void)set:(NSString *)app
59
+ dbURL:(NSString *)dbURL
60
+ path:(NSString *)path
61
+ props:(NSDictionary *)props
62
+ resolve:(RCTPromiseResolveBlock)resolve
63
+ reject:(RCTPromiseRejectBlock)reject {
64
+ FIRApp *firebaseApp = [RCTConvert firAppFromString:app];
44
65
  FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
45
66
  FIRDatabaseReference *firDatabaseReference =
46
67
  [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
@@ -55,13 +76,13 @@ RCT_EXPORT_METHOD(set
55
76
  }];
56
77
  }
57
78
 
58
- RCT_EXPORT_METHOD(update
59
- : (FIRApp *)firebaseApp
60
- : (NSString *)dbURL
61
- : (NSString *)path
62
- : (NSDictionary *)props
63
- : (RCTPromiseResolveBlock)resolve
64
- : (RCTPromiseRejectBlock)reject) {
79
+ - (void)update:(NSString *)app
80
+ dbURL:(NSString *)dbURL
81
+ path:(NSString *)path
82
+ props:(NSDictionary *)props
83
+ resolve:(RCTPromiseResolveBlock)resolve
84
+ reject:(RCTPromiseRejectBlock)reject {
85
+ FIRApp *firebaseApp = [RCTConvert firAppFromString:app];
65
86
  FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
66
87
  FIRDatabaseReference *firDatabaseReference =
67
88
  [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
@@ -76,13 +97,13 @@ RCT_EXPORT_METHOD(update
76
97
  }];
77
98
  }
78
99
 
79
- RCT_EXPORT_METHOD(setWithPriority
80
- : (FIRApp *)firebaseApp
81
- : (NSString *)dbURL
82
- : (NSString *)path
83
- : (NSDictionary *)props
84
- : (RCTPromiseResolveBlock)resolve
85
- : (RCTPromiseRejectBlock)reject) {
100
+ - (void)setWithPriority:(NSString *)app
101
+ dbURL:(NSString *)dbURL
102
+ path:(NSString *)path
103
+ props:(NSDictionary *)props
104
+ resolve:(RCTPromiseResolveBlock)resolve
105
+ reject:(RCTPromiseRejectBlock)reject {
106
+ FIRApp *firebaseApp = [RCTConvert firAppFromString:app];
86
107
  FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
87
108
  FIRDatabaseReference *firDatabaseReference =
88
109
  [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
@@ -98,12 +119,12 @@ RCT_EXPORT_METHOD(setWithPriority
98
119
  }];
99
120
  }
100
121
 
101
- RCT_EXPORT_METHOD(remove
102
- : (FIRApp *)firebaseApp
103
- : (NSString *)dbURL
104
- : (NSString *)path
105
- : (RCTPromiseResolveBlock)resolve
106
- : (RCTPromiseRejectBlock)reject) {
122
+ - (void)remove:(NSString *)app
123
+ dbURL:(NSString *)dbURL
124
+ path:(NSString *)path
125
+ resolve:(RCTPromiseResolveBlock)resolve
126
+ reject:(RCTPromiseRejectBlock)reject {
127
+ FIRApp *firebaseApp = [RCTConvert firAppFromString:app];
107
128
  FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
108
129
  FIRDatabaseReference *firDatabaseReference =
109
130
  [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
@@ -118,13 +139,13 @@ RCT_EXPORT_METHOD(remove
118
139
  }];
119
140
  }
120
141
 
121
- RCT_EXPORT_METHOD(setPriority
122
- : (FIRApp *)firebaseApp
123
- : (NSString *)dbURL
124
- : (NSString *)path
125
- : (NSDictionary *)props
126
- : (RCTPromiseResolveBlock)resolve
127
- : (RCTPromiseRejectBlock)reject) {
142
+ - (void)setPriority:(NSString *)app
143
+ dbURL:(NSString *)dbURL
144
+ path:(NSString *)path
145
+ props:(NSDictionary *)props
146
+ resolve:(RCTPromiseResolveBlock)resolve
147
+ reject:(RCTPromiseRejectBlock)reject {
148
+ FIRApp *firebaseApp = [RCTConvert firAppFromString:app];
128
149
  FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
129
150
  FIRDatabaseReference *firDatabaseReference =
130
151
  [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
@@ -18,19 +18,34 @@
18
18
  #import <Firebase/Firebase.h>
19
19
  #import <React/RCTUtils.h>
20
20
 
21
+ #import "RNFBApp/RCTConvert+FIRApp.h"
21
22
  #import "RNFBDatabaseCommon.h"
22
23
  #import "RNFBDatabaseTransactionModule.h"
24
+ #import "RNFBDatabaseTurboModules.h"
23
25
  #import "RNFBRCTEventEmitter.h"
24
26
  #import "RNFBSharedUtils.h"
25
27
 
26
28
  static __strong NSMutableDictionary *transactions;
27
29
  static NSString *const RNFB_DATABASE_TRANSACTION_EVENT = @"database_transaction_event";
28
30
 
31
+ @interface RNFBDatabaseTransactionModule () <NativeRNFBTurboDatabaseTransactionSpec,
32
+ RCTBridgeModule>
33
+ @end
34
+
29
35
  @implementation RNFBDatabaseTransactionModule
30
36
  #pragma mark -
31
37
  #pragma mark Module Setup
32
38
 
33
- RCT_EXPORT_MODULE();
39
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
40
+ (const facebook::react::ObjCTurboModule::InitParams &)params {
41
+ return std::make_shared<facebook::react::NativeRNFBTurboDatabaseTransactionSpecJSI>(params);
42
+ }
43
+
44
+ RCT_EXPORT_MODULE(NativeRNFBTurboDatabaseTransaction);
45
+
46
+ + (BOOL)requiresMainQueueSetup {
47
+ return NO;
48
+ }
34
49
 
35
50
  - (dispatch_queue_t)methodQueue {
36
51
  return [RNFBDatabaseCommon getDispatchQueue];
@@ -48,15 +63,32 @@ RCT_EXPORT_MODULE();
48
63
  return self;
49
64
  }
50
65
 
66
+ - (void)dealloc {
67
+ [self invalidate];
68
+ }
69
+
70
+ - (void)invalidate {
71
+ dispatch_sync(_transactionQueue, ^{
72
+ for (NSString *key in [transactions allKeys]) {
73
+ NSMutableDictionary *transactionState = transactions[key];
74
+ [transactionState setValue:@true forKey:@"abort"];
75
+ dispatch_semaphore_t sema = [transactionState valueForKey:@"semaphore"];
76
+ if (sema) {
77
+ dispatch_semaphore_signal(sema);
78
+ }
79
+ [transactions removeObjectForKey:key];
80
+ }
81
+ });
82
+ }
83
+
51
84
  #pragma mark -
52
85
  #pragma mark Firebase Database
53
86
 
54
- RCT_EXPORT_METHOD(transactionStart
55
- : (FIRApp *)firebaseApp
56
- : (NSString *)dbURL
57
- : (NSString *)path
58
- : (nonnull NSNumber *)transactionId
59
- : (BOOL)applyLocally) {
87
+ - (void)transactionStart:(NSString *)app
88
+ dbURL:(NSString *)dbURL
89
+ path:(NSString *)path
90
+ transactionId:(double)transactionId
91
+ applyLocally:(BOOL)applyLocally {
60
92
  dispatch_async(_transactionQueue, ^{
61
93
  NSMutableDictionary *transactionState = [NSMutableDictionary new];
62
94
  dispatch_semaphore_t sema = dispatch_semaphore_create(0);
@@ -64,19 +96,20 @@ RCT_EXPORT_METHOD(transactionStart
64
96
  #pragma ide diagnostic ignored "err_typecheck_convert_incompatible"
65
97
  transactionState[@"semaphore"] = sema;
66
98
  #pragma clang diagnostic pop
99
+ FIRApp *firebaseApp = [RCTConvert firAppFromString:app];
67
100
  FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
68
101
  FIRDatabaseReference *firDatabaseReference =
69
102
  [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
70
103
 
71
104
  id runTransactionBlock = ^FIRTransactionResult *(FIRMutableData *currentData) {
72
105
  dispatch_barrier_async(self->_transactionQueue, ^{
73
- [transactions setValue:transactionState forKey:[transactionId stringValue]];
106
+ [transactions setValue:transactionState forKey:[@(transactionId) stringValue]];
74
107
 
75
108
  [[RNFBRCTEventEmitter shared]
76
109
  sendEventWithName:RNFB_DATABASE_TRANSACTION_EVENT
77
110
  body:@{
78
111
  @"appName" : [RNFBSharedUtils getAppJavaScriptName:firDatabase.app.name],
79
- @"id" : transactionId,
112
+ @"id" : @(transactionId),
80
113
  @"body" : @{
81
114
  @"type" : @"update",
82
115
  @"value" : currentData.value,
@@ -84,10 +117,6 @@ RCT_EXPORT_METHOD(transactionStart
84
117
  }];
85
118
  });
86
119
 
87
- // wait for the js event handler to call tryCommitTransaction
88
- // this wait occurs on the Firebase Worker Queue
89
- // so if the tryCommitTransaction fails to signal the semaphore
90
- // no further blocks will be executed by Firebase until the timeout expires
91
120
  dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, 30 * NSEC_PER_SEC);
92
121
  BOOL timedout = dispatch_semaphore_wait(sema, delayTime) != 0;
93
122
 
@@ -95,7 +124,7 @@ RCT_EXPORT_METHOD(transactionStart
95
124
  id value = [transactionState valueForKey:@"value"];
96
125
 
97
126
  dispatch_barrier_async(self->_transactionQueue, ^{
98
- [transactions removeObjectForKey:[transactionId stringValue]];
127
+ [transactions removeObjectForKey:[@(transactionId) stringValue]];
99
128
  });
100
129
 
101
130
  if (abort) {
@@ -125,7 +154,7 @@ RCT_EXPORT_METHOD(transactionStart
125
154
  [[RNFBRCTEventEmitter shared]
126
155
  sendEventWithName:RNFB_DATABASE_TRANSACTION_EVENT
127
156
  body:@{
128
- @"id" : transactionId,
157
+ @"id" : @(transactionId),
129
158
  @"appName" : [RNFBSharedUtils getAppJavaScriptName:firDatabase.app.name],
130
159
  @"body" : resultMap,
131
160
  }];
@@ -137,19 +166,18 @@ RCT_EXPORT_METHOD(transactionStart
137
166
  });
138
167
  }
139
168
 
140
- RCT_EXPORT_METHOD(transactionTryCommit
141
- : (FIRApp *)firebaseApp
142
- : (NSString *)dbURL
143
- : (nonnull NSNumber *)transactionId
144
- : (NSDictionary *)updates) {
169
+ - (void)transactionTryCommit:(NSString *)app
170
+ dbURL:(NSString *)dbURL
171
+ transactionId:(double)transactionId
172
+ updates:(NSDictionary *)updates {
145
173
  __block NSMutableDictionary *transactionState;
146
174
 
147
175
  dispatch_sync(_transactionQueue, ^{
148
- transactionState = transactions[[transactionId stringValue]];
176
+ transactionState = transactions[[@(transactionId) stringValue]];
149
177
  });
150
178
 
151
179
  if (!transactionState) {
152
- NSLog(@"tryCommitTransaction for unknown ID %@", transactionId);
180
+ NSLog(@"tryCommitTransaction for unknown ID %@", @(transactionId));
153
181
  return;
154
182
  }
155
183
 
@@ -165,8 +193,4 @@ RCT_EXPORT_METHOD(transactionTryCommit
165
193
  dispatch_semaphore_signal([transactionState valueForKey:@"semaphore"]);
166
194
  }
167
195
 
168
- + (BOOL)requiresMainQueueSetup {
169
- return YES;
170
- }
171
-
172
196
  @end
@@ -7,13 +7,13 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
- 2744B98621F45429004F8E3F /* RNFBDatabaseModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 2744B98521F45429004F8E3F /* RNFBDatabaseModule.m */; };
10
+ 2744B98621F45429004F8E3F /* RNFBDatabaseModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744B98521F45429004F8E3F /* RNFBDatabaseModule.mm */; };
11
11
  8B9DD3BA22A03C7900A16945 /* RNFBDatabaseQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B9DD3B922A03C7900A16945 /* RNFBDatabaseQuery.m */; };
12
- 8B9DD3BD22A05CEB00A16945 /* RNFBDatabaseOnDisconnectModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B9DD3BC22A05CEB00A16945 /* RNFBDatabaseOnDisconnectModule.m */; };
12
+ 8B9DD3BD22A05CEB00A16945 /* RNFBDatabaseOnDisconnectModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8B9DD3BC22A05CEB00A16945 /* RNFBDatabaseOnDisconnectModule.mm */; };
13
13
  8B9DD3C222A0617400A16945 /* RNFBDatabaseCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B9DD3C122A0617400A16945 /* RNFBDatabaseCommon.m */; };
14
- 8B9DD3C622A11F4F00A16945 /* RNFBDatabaseReferenceModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B9DD3C522A11F4F00A16945 /* RNFBDatabaseReferenceModule.m */; };
15
- 8B9DD3C922A1258B00A16945 /* RNFBDatabaseQueryModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B9DD3C822A1258B00A16945 /* RNFBDatabaseQueryModule.m */; };
16
- 8B9DD3CE22A43D1400A16945 /* RNFBDatabaseTransactionModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B9DD3CD22A43D1400A16945 /* RNFBDatabaseTransactionModule.m */; };
14
+ 8B9DD3C622A11F4F00A16945 /* RNFBDatabaseReferenceModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8B9DD3C522A11F4F00A16945 /* RNFBDatabaseReferenceModule.mm */; };
15
+ 8B9DD3C922A1258B00A16945 /* RNFBDatabaseQueryModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8B9DD3C822A1258B00A16945 /* RNFBDatabaseQueryModule.mm */; };
16
+ 8B9DD3CE22A43D1400A16945 /* RNFBDatabaseTransactionModule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8B9DD3CD22A43D1400A16945 /* RNFBDatabaseTransactionModule.mm */; };
17
17
  /* End PBXBuildFile section */
18
18
 
19
19
  /* Begin PBXCopyFilesBuildPhase section */
@@ -31,19 +31,19 @@
31
31
  /* Begin PBXFileReference section */
32
32
  2744B98221F45429004F8E3F /* libRNFBDatabase.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFBDatabase.a; sourceTree = BUILT_PRODUCTS_DIR; };
33
33
  2744B98421F45429004F8E3F /* RNFBDatabaseModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBDatabaseModule.h; path = RNFBDatabase/RNFBDatabaseModule.h; sourceTree = SOURCE_ROOT; };
34
- 2744B98521F45429004F8E3F /* RNFBDatabaseModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBDatabaseModule.m; path = RNFBDatabase/RNFBDatabaseModule.m; sourceTree = SOURCE_ROOT; };
34
+ 2744B98521F45429004F8E3F /* RNFBDatabaseModule.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBDatabaseModule.mm; path = RNFBDatabase/RNFBDatabaseModule.mm; sourceTree = SOURCE_ROOT; };
35
35
  8B9DD3B822A03C6700A16945 /* RNFBDatabaseQuery.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBDatabaseQuery.h; sourceTree = "<group>"; };
36
36
  8B9DD3B922A03C7900A16945 /* RNFBDatabaseQuery.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseQuery.m; sourceTree = "<group>"; };
37
- 8B9DD3BC22A05CEB00A16945 /* RNFBDatabaseOnDisconnectModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseOnDisconnectModule.m; sourceTree = "<group>"; };
37
+ 8B9DD3BC22A05CEB00A16945 /* RNFBDatabaseOnDisconnectModule.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseOnDisconnectModule.mm; sourceTree = "<group>"; };
38
38
  8B9DD3BE22A05D0400A16945 /* RNFBDatabaseOnDisconnectModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBDatabaseOnDisconnectModule.h; sourceTree = "<group>"; };
39
39
  8B9DD3C022A0616300A16945 /* RNFBDatabaseCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBDatabaseCommon.h; sourceTree = "<group>"; };
40
40
  8B9DD3C122A0617400A16945 /* RNFBDatabaseCommon.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseCommon.m; sourceTree = "<group>"; };
41
41
  8B9DD3C422A11F3E00A16945 /* RNFBDatabaseReferenceModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBDatabaseReferenceModule.h; sourceTree = "<group>"; };
42
- 8B9DD3C522A11F4F00A16945 /* RNFBDatabaseReferenceModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseReferenceModule.m; sourceTree = "<group>"; };
43
- 8B9DD3C822A1258B00A16945 /* RNFBDatabaseQueryModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseQueryModule.m; sourceTree = "<group>"; };
42
+ 8B9DD3C522A11F4F00A16945 /* RNFBDatabaseReferenceModule.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseReferenceModule.mm; sourceTree = "<group>"; };
43
+ 8B9DD3C822A1258B00A16945 /* RNFBDatabaseQueryModule.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseQueryModule.mm; sourceTree = "<group>"; };
44
44
  8B9DD3CA22A1259F00A16945 /* RNFBDatabaseQueryModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBDatabaseQueryModule.h; sourceTree = "<group>"; };
45
45
  8B9DD3CC22A43D0300A16945 /* RNFBDatabaseTransactionModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFBDatabaseTransactionModule.h; sourceTree = "<group>"; };
46
- 8B9DD3CD22A43D1400A16945 /* RNFBDatabaseTransactionModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseTransactionModule.m; sourceTree = "<group>"; };
46
+ 8B9DD3CD22A43D1400A16945 /* RNFBDatabaseTransactionModule.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBDatabaseTransactionModule.mm; sourceTree = "<group>"; };
47
47
  /* End PBXFileReference section */
48
48
 
49
49
  /* Begin PBXFrameworksBuildPhase section */
@@ -69,19 +69,19 @@
69
69
  isa = PBXGroup;
70
70
  children = (
71
71
  2744B98421F45429004F8E3F /* RNFBDatabaseModule.h */,
72
- 2744B98521F45429004F8E3F /* RNFBDatabaseModule.m */,
72
+ 2744B98521F45429004F8E3F /* RNFBDatabaseModule.mm */,
73
73
  8B9DD3B822A03C6700A16945 /* RNFBDatabaseQuery.h */,
74
74
  8B9DD3B922A03C7900A16945 /* RNFBDatabaseQuery.m */,
75
- 8B9DD3BC22A05CEB00A16945 /* RNFBDatabaseOnDisconnectModule.m */,
75
+ 8B9DD3BC22A05CEB00A16945 /* RNFBDatabaseOnDisconnectModule.mm */,
76
76
  8B9DD3BE22A05D0400A16945 /* RNFBDatabaseOnDisconnectModule.h */,
77
77
  8B9DD3C022A0616300A16945 /* RNFBDatabaseCommon.h */,
78
78
  8B9DD3C122A0617400A16945 /* RNFBDatabaseCommon.m */,
79
79
  8B9DD3C422A11F3E00A16945 /* RNFBDatabaseReferenceModule.h */,
80
- 8B9DD3C522A11F4F00A16945 /* RNFBDatabaseReferenceModule.m */,
81
- 8B9DD3C822A1258B00A16945 /* RNFBDatabaseQueryModule.m */,
80
+ 8B9DD3C522A11F4F00A16945 /* RNFBDatabaseReferenceModule.mm */,
81
+ 8B9DD3C822A1258B00A16945 /* RNFBDatabaseQueryModule.mm */,
82
82
  8B9DD3CA22A1259F00A16945 /* RNFBDatabaseQueryModule.h */,
83
83
  8B9DD3CC22A43D0300A16945 /* RNFBDatabaseTransactionModule.h */,
84
- 8B9DD3CD22A43D1400A16945 /* RNFBDatabaseTransactionModule.m */,
84
+ 8B9DD3CD22A43D1400A16945 /* RNFBDatabaseTransactionModule.mm */,
85
85
  );
86
86
  path = RNFBDatabase;
87
87
  sourceTree = "<group>";
@@ -153,12 +153,12 @@
153
153
  isa = PBXSourcesBuildPhase;
154
154
  buildActionMask = 2147483647;
155
155
  files = (
156
- 8B9DD3BD22A05CEB00A16945 /* RNFBDatabaseOnDisconnectModule.m in Sources */,
157
- 8B9DD3C922A1258B00A16945 /* RNFBDatabaseQueryModule.m in Sources */,
158
- 8B9DD3CE22A43D1400A16945 /* RNFBDatabaseTransactionModule.m in Sources */,
156
+ 8B9DD3BD22A05CEB00A16945 /* RNFBDatabaseOnDisconnectModule.mm in Sources */,
157
+ 8B9DD3C922A1258B00A16945 /* RNFBDatabaseQueryModule.mm in Sources */,
158
+ 8B9DD3CE22A43D1400A16945 /* RNFBDatabaseTransactionModule.mm in Sources */,
159
159
  8B9DD3C222A0617400A16945 /* RNFBDatabaseCommon.m in Sources */,
160
- 8B9DD3C622A11F4F00A16945 /* RNFBDatabaseReferenceModule.m in Sources */,
161
- 2744B98621F45429004F8E3F /* RNFBDatabaseModule.m in Sources */,
160
+ 8B9DD3C622A11F4F00A16945 /* RNFBDatabaseReferenceModule.mm in Sources */,
161
+ 2744B98621F45429004F8E3F /* RNFBDatabaseModule.mm in Sources */,
162
162
  8B9DD3BA22A03C7900A16945 /* RNFBDatabaseQuery.m in Sources */,
163
163
  );
164
164
  runOnlyForDeploymentPostprocessing = 0;
@@ -194,7 +194,7 @@
194
194
  );
195
195
  GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
196
196
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
197
- IPHONEOS_DEPLOYMENT_TARGET = 10.0;
197
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
198
198
  MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
199
199
  MTL_FAST_MATH = YES;
200
200
  OTHER_LDFLAGS = "-ObjC";
@@ -228,7 +228,7 @@
228
228
  GCC_C_LANGUAGE_STANDARD = gnu11;
229
229
  GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
230
230
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
231
- IPHONEOS_DEPLOYMENT_TARGET = 10.0;
231
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
232
232
  MTL_ENABLE_DEBUG_INFO = NO;
233
233
  MTL_FAST_MATH = YES;
234
234
  OTHER_LDFLAGS = "-ObjC";
@@ -289,7 +289,7 @@
289
289
  "$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**",
290
290
  "$(SRCROOT)/../../../packages/app/ios/**",
291
291
  );
292
- IPHONEOS_DEPLOYMENT_TARGET = 10.0;
292
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
293
293
  LIBRARY_SEARCH_PATHS = "$(inherited)";
294
294
  MACH_O_TYPE = staticlib;
295
295
  OTHER_LDFLAGS = "$(inherited)";
@@ -347,7 +347,7 @@
347
347
  "$(SRCROOT)/../../../node_modules/react-native-firebase/ios/**",
348
348
  "$(SRCROOT)/../../../packages/app/ios/**",
349
349
  );
350
- IPHONEOS_DEPLOYMENT_TARGET = 10.0;
350
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
351
351
  LIBRARY_SEARCH_PATHS = "$(inherited)";
352
352
  MACH_O_TYPE = staticlib;
353
353
  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,18 @@
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
+ @interface RCTModulesConformingToProtocolsProvider: NSObject
11
+
12
+ +(NSArray<NSString *> *)imageURLLoaderClassNames;
13
+
14
+ +(NSArray<NSString *> *)imageDataDecoderClassNames;
15
+
16
+ +(NSArray<NSString *> *)URLRequestHandlerClassNames;
17
+
18
+ @end
@@ -0,0 +1,33 @@
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 "RCTModulesConformingToProtocolsProvider.h"
9
+
10
+ @implementation RCTModulesConformingToProtocolsProvider
11
+
12
+ +(NSArray<NSString *> *)imageURLLoaderClassNames
13
+ {
14
+ return @[
15
+
16
+ ];
17
+ }
18
+
19
+ +(NSArray<NSString *> *)imageDataDecoderClassNames
20
+ {
21
+ return @[
22
+
23
+ ];
24
+ }
25
+
26
+ +(NSArray<NSString *> *)URLRequestHandlerClassNames
27
+ {
28
+ return @[
29
+
30
+ ];
31
+ }
32
+
33
+ @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 RCTComponentViewProtocol;
11
+
12
+ @interface RCTThirdPartyComponentsProvider: NSObject
13
+
14
+ + (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
15
+
16
+ @end
@@ -0,0 +1,23 @@
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
+ #import "RCTThirdPartyComponentsProvider.h"
12
+ #import <React/RCTComponentViewProtocol.h>
13
+
14
+ @implementation RCTThirdPartyComponentsProvider
15
+
16
+ + (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
17
+ {
18
+ return @{
19
+
20
+ };
21
+ }
22
+
23
+ @end