Get Started

Twilio Client for iOS Quickstart Tutorial

Hanging up from your iOS Device

Congratulations on making your first audio connection from your iOS device to Twilio!

You should have heard a welcome message but as you probably noticed, you had no way to close the connection as the Hangup button doesn't do anything. So, let's add some functionality to do that.

Let us just add code in HelloMonkeyViewController to hangup ongoing connection.

HelloMonkeyViewController.m
- (IBAction)hangupButtonPressed:(id)sender
{
    [_connection disconnect];
}

That's everything! Go ahead and make another call. You can now press the hangup button at any time and your connection will close.


Next: Connecting to a TwiML Application »