[android][ios][database] Add missing setPriority and setWithPriority methods

This commit is contained in:
Chris Bianca
2017-07-19 18:18:16 +01:00
parent c2400edd0a
commit 46772d253d
6 changed files with 137 additions and 12 deletions

View File

@@ -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: