Skip to content

Commit

Permalink
fix: align iOS params to Android
Browse files Browse the repository at this point in the history
fixed connectionDidConnect, connectionDidDisconnect.
fixes #44 #62
  • Loading branch information
fabriziomoscon committed Oct 23, 2020
1 parent b42e343 commit 756d256
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions ios/RNTwilioVoice/RNTwilioVoice.m
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ - (void)handleCallInviteCanceled:(TVOCallInvite *)callInvite {
[params setObject:self.callInvite.callSid forKey:@"call_sid"];
}

if (self.callInvite.from){
[params setObject:self.callInvite.from forKey:@"from"];
if (self.callInvite.from) {
[params setObject:self.callInvite.from forKey:@"call_from"];
}
if (self.callInvite.to){
[params setObject:self.callInvite.to forKey:@"to"];
if (self.callInvite.to) {
[params setObject:self.callInvite.to forKey:@"call_to"];
}
if (self.callInvite.state == TVOCallInviteStateCanceled) {
[params setObject:StateDisconnected forKey:@"call_state"];
Expand Down Expand Up @@ -337,11 +337,11 @@ - (void)callDidConnect:(TVOCall *)call {
[callParams setObject:StateConnected forKey:@"call_state"];
}

if (call.from){
[callParams setObject:call.from forKey:@"from"];
if (call.from) {
[callParams setObject:call.from forKey:@"call_from"];
}
if (call.to){
[callParams setObject:call.to forKey:@"to"];
if (call.to) {
[callParams setObject:call.to forKey:@"call_to"];
}
[self sendEventWithName:@"connectionDidConnect" body:callParams];
}
Expand All @@ -367,12 +367,11 @@ - (void)callDisconnected:(NSError *)error {
if (error.localizedFailureReason) {
errMsg = [error localizedFailureReason];
}
[params setObject:errMsg forKey:@"error"];
[params setObject:errMsg forKey:@"err"];
}
if (self.call.sid) {
[params setObject:self.call.sid forKey:@"call_sid"];
}
if (self.call.to){
[params setObject:self.call.to forKey:@"call_to"];
}
if (self.call.from){
Expand Down

0 comments on commit 756d256

Please sign in to comment.