Merge pull request #58 from alexkuttig/master

fixed onDisconnectSet on iOS
This commit is contained in:
Michael Diarmid 2017-04-19 12:30:35 +01:00 committed by GitHub
commit c40de1b3f1
1 changed files with 2 additions and 13 deletions

View File

@ -614,28 +614,17 @@ RCT_EXPORT_METHOD(off:(NSString *)path
} }
// On disconnect // On disconnect
RCT_EXPORT_METHOD(onDisconnectSetObject:(NSString *) path RCT_EXPORT_METHOD(onDisconnectSet:(NSString *) path
props:(NSDictionary *) props props:(NSDictionary *) props
callback:(RCTResponseSenderBlock) callback) callback:(RCTResponseSenderBlock) callback)
{ {
FIRDatabaseReference *ref = [self getPathRef:path]; FIRDatabaseReference *ref = [self getPathRef:path];
[ref onDisconnectSetValue:props [ref onDisconnectSetValue:props[@"value"]
withCompletionBlock:^(NSError * _Nullable error, FIRDatabaseReference * _Nonnull ref) { withCompletionBlock:^(NSError * _Nullable error, FIRDatabaseReference * _Nonnull ref) {
[self handleCallback:@"onDisconnectSetObject" callback:callback databaseError:error]; [self handleCallback:@"onDisconnectSetObject" callback:callback databaseError:error];
}]; }];
} }
RCT_EXPORT_METHOD(onDisconnectSetString:(NSString *) path
val:(NSString *) val
callback:(RCTResponseSenderBlock) callback)
{
FIRDatabaseReference *ref = [self getPathRef:path];
[ref onDisconnectSetValue:val
withCompletionBlock:^(NSError * _Nullable error, FIRDatabaseReference * _Nonnull ref) {
[self handleCallback:@"onDisconnectSetString" callback:callback databaseError:error];
}];
}
RCT_EXPORT_METHOD(onDisconnectRemove:(NSString *) path RCT_EXPORT_METHOD(onDisconnectRemove:(NSString *) path
callback:(RCTResponseSenderBlock) callback) callback:(RCTResponseSenderBlock) callback)
{ {