Skip to content
This repository was archived by the owner on Jan 18, 2020. It is now read-only.

Commit 3985d1e

Browse files
lonnylotbobiechen-twilio
authored andcommitted
Correctly find callInvite to cancel (#198)
* Correctly find callInvite to cancel I'm a novice at iOS development, but in my attempt to copy this QuickStart implementation into hoxfon/react-native-twilio-programmable-voice#138 I needed to make this change to get the cancel to work correctly. I wanted to share this change with you, but I have not tested it in this repo myself. Please confirm and merge if it is an issue. * Updated key name to uuid
1 parent b8c0a9f commit 3985d1e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ObjcVoiceQuickstart/ViewController.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,10 @@ - (void)cancelledCallInviteReceived:(TVOCancelledCallInvite *)cancelledCallInvit
356356
NSLog(@"cancelledCallInviteReceived:");
357357

358358
TVOCallInvite *callInvite;
359-
for (TVOCallInvite *invite in self.activeCallInvites) {
360-
if ([cancelledCallInvite.callSid isEqualToString:invite.callSid]) {
361-
callInvite = invite;
359+
for (NSString *uuid in self.activeCallInvites) {
360+
TVOCallInvite *activeCallInvite = [self.activeCallInvites objectForKey:uuid];
361+
if ([cancelledCallInvite.callSid isEqualToString:activeCallInvite.callSid]) {
362+
callInvite = activeCallInvite;
362363
break;
363364
}
364365
}

0 commit comments

Comments
 (0)