fixed onDisconnectSet on iOS

removed onDisconnectSetString
renamed onDisconnectSetObject to onDisconnectSet
called Firebase onDisconnectSetValue with props.value
This commit is contained in:
Alexander Kuttig 2017-04-19 13:05:23 +02:00
parent e6d2693f33
commit 127bdfbbee
1 changed files with 2 additions and 13 deletions

View File

@ -614,28 +614,17 @@ RCT_EXPORT_METHOD(off:(NSString *)path
}
// On disconnect
RCT_EXPORT_METHOD(onDisconnectSetObject:(NSString *) path
RCT_EXPORT_METHOD(onDisconnectSet:(NSString *) path
props:(NSDictionary *) props
callback:(RCTResponseSenderBlock) callback)
{
FIRDatabaseReference *ref = [self getPathRef:path];
[ref onDisconnectSetValue:props
[ref onDisconnectSetValue:props[@"value"]
withCompletionBlock:^(NSError * _Nullable error, FIRDatabaseReference * _Nonnull ref) {
[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
callback:(RCTResponseSenderBlock) callback)
{