mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-28 12:15:44 +08:00
[android][ios][database] Add missing setPriority and setWithPriority methods
This commit is contained in:
@@ -148,6 +148,25 @@ RCT_EXPORT_METHOD(set:
|
||||
}];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(priority:(NSString *) path
|
||||
priorityData:(NSDictionary *) priorityData
|
||||
callback:(RCTResponseSenderBlock) callback) {
|
||||
FIRDatabaseReference *ref = [self getPathRef:path];
|
||||
[ref setPriority:[priorityData valueForKey:@"value"] withCompletionBlock:^(NSError * _Nullable error, FIRDatabaseReference * _Nonnull ref) {
|
||||
[self handleCallback:@"priority" callback:callback databaseError:error];
|
||||
}];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(withPriority:(NSString *) path
|
||||
data:(NSDictionary *) data
|
||||
priorityData:(NSDictionary *) priorityData
|
||||
callback:(RCTResponseSenderBlock) callback) {
|
||||
FIRDatabaseReference *ref = [self getPathRef:path];
|
||||
[ref setValue:[data valueForKey:@"value"] andPriority:[priorityData valueForKey:@"value"] withCompletionBlock:^(NSError * _Nullable error, FIRDatabaseReference * _Nonnull ref) {
|
||||
[self handleCallback:@"withPriority" callback:callback databaseError:error];
|
||||
}];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(update:
|
||||
(NSString *) path
|
||||
value:
|
||||
|
||||
Reference in New Issue
Block a user