Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziomoscon committed Oct 23, 2020
1 parent 8971772 commit a02a727
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions ios/RNTwilioVoice/RNTwilioVoice.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ - (void)dealloc {
[self toggleAudioRoute:speaker];
}

RCT_EXPORT_METHOD(sendDigits: (NSString *)digits){
RCT_EXPORT_METHOD(sendDigits: (NSString *)digits) {
if (self.call && self.call.state == TVOCallStateConnected) {
NSLog(@"SendDigits %@", digits);
[self.call sendDigits:digits];
}
}

RCT_EXPORT_METHOD(unregister){
RCT_EXPORT_METHOD(unregister) {
NSLog(@"unregister");
NSString *accessToken = [self fetchAccessToken];

Expand All @@ -148,16 +148,16 @@ - (void)dealloc {

RCT_REMAP_METHOD(getActiveCall,
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject){
rejecter:(RCTPromiseRejectBlock)reject) {
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
if (self.callInvite) {
if (self.callInvite.callSid){
if (self.callInvite.callSid) {
[params setObject:self.callInvite.callSid forKey:@"call_sid"];
}
if (self.callInvite.from){
if (self.callInvite.from) {
[params setObject:self.callInvite.from forKey:@"from"];
}
if (self.callInvite.to){
if (self.callInvite.to) {
[params setObject:self.callInvite.to forKey:@"to"];
}
if (self.callInvite.state == TVOCallInviteStatePending) {
Expand All @@ -172,10 +172,10 @@ - (void)dealloc {
if (self.call.sid) {
[params setObject:self.call.sid forKey:@"call_sid"];
}
if (self.call.to){
if (self.call.to) {
[params setObject:self.call.to forKey:@"call_to"];
}
if (self.call.from){
if (self.call.from) {
[params setObject:self.call.from forKey:@"call_from"];
}
if (self.call.state == TVOCallStateConnected) {
Expand Down Expand Up @@ -299,7 +299,7 @@ - (void)handleCallInviteCanceled:(TVOCallInvite *)callInvite {
[self performEndCallActionWithUUID:callInvite.uuid];

NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
if (self.callInvite.callSid){
if (self.callInvite.callSid) {
[params setObject:self.callInvite.callSid forKey:@"call_sid"];
}

Expand Down Expand Up @@ -372,9 +372,10 @@ - (void)callDisconnected:(NSError *)error {
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){
if (self.call.from) {
[params setObject:self.call.from forKey:@"call_from"];
}
if (self.call.state == TVOCallStateDisconnected) {
Expand Down

0 comments on commit a02a727

Please sign in to comment.