Skip to content

Commit

Permalink
Merge pull request #58 from alexkuttig/master
Browse files Browse the repository at this point in the history
fixed onDisconnectSet on iOS
  • Loading branch information
Salakar committed Apr 19, 2017
2 parents e6d2693 + 127bdfb commit c40de1b
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions ios/RNFirebase/RNFirebaseDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -614,28 +614,17 @@ - (void) sendTransactionEvent:(NSString *)type body:(id)body {
}

// 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)
{
Expand Down

0 comments on commit c40de1b

Please sign in to comment.