简体   繁体   中英

Outgoing calls with Twilio iOS Client

I am using the Twilio API and can successfully make outgoing calls to a phone number, but when I try to enter another username to connect to, nothing happens. I have two emulators running (one with the Android quickstart client, with which I can make outgoing calls to another user. I can make calls from the Android client to the iOS client using usernames and it works fine, but when I try to do the same from the iOS client to the Android client, nothing happens. I don't get a crash or anything, I just get the initial sound that it tries to start, then the disconnect sound. Here is my code:

- (IBAction)dialButtonPressed:(id)sender {
    [self.dialField resignFirstResponder];
    NSDictionary *params = @{@"To": self.dialField.text};
    _connection = [_phone connect:params delegate:nil];
}

I have searched everywhere I can think of online, but every reference seems to talk only about calls with a phone number. The Twilio API for Android handles this easily, but I cannot figure it out for iOS. Any suggestions would be greatly appreciated.

Thanks in advance!!

Much thanks to Zack from Twilio who finally noticed that we just needed to add client: before the username when trying to call a user rather than a phone number (When using the Heroku App for the server setup as instructed in the Quickstart tutorial). Not sure why this is not built into the iOS instructions, but it is to the Android version. I'm just glad to have something that works.

I just have to dial client: then the username right into the dial field and it works. Now I can make any desired programming changes.

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM