TwilioVoice Class Reference

Inherits from NSObject
Declared in TwilioVoice.h

Overview

The TwilioVoice is the entry point for interaction with the Twilio service.

CallKit Audio Session Handling

Other Methods

  logLevel

Logging level of the SDK.

@property (nonatomic, assign, class) TVOLogLevel logLevel

Discussion

The default logging level of the SDK is TVOLogLevelError.

See Also

Declared In

TwilioVoice.h

  region

The region (Twilio data center) for the SDK.

@property (nonatomic, copy, nonnull, class) NSString *region

Discussion

The default region uses Global Low Latency routing, which establishes a connection with the closest region to the user. Note: Setting the region during a call will not apply until all ongoing calls have ended and a subsequent call is placed.

Declared In

TwilioVoice.h

+ version

Returns the version of the SDK.

+ (nonnull NSString *)version

Return Value

The version of the SDK.

Declared In

TwilioVoice.h

+ setModule:logLevel:

Sets logging level for an individual module.

+ (void)setModule:(TVOLogModule)module logLevel:(TVOLogLevel)level

Parameters

module

The TVOLogModule for which the logging level is to be set.

level

The TVOLogLevel level to be used by the module.

Declared In

TwilioVoice.h

Managing VoIP Push Notifications

+ registerWithAccessToken:deviceToken:completion:

Registers for Twilio VoIP push notifications.

+ (void)registerWithAccessToken:(nonnull NSString *)accessToken deviceToken:(nonnull NSString *)deviceToken completion:(nullable void ( ^ ) ( NSError *__nullable error ))completion

Parameters

accessToken

Twilio Access Token.

deviceToken

The push registry token for Apple VoIP Service.

completion

Callback block to receive the result of the registration.

Declared In

TwilioVoice.h

+ unregisterWithAccessToken:deviceToken:completion:

Unregisters from Twilio VoIP push notifications.

+ (void)unregisterWithAccessToken:(nonnull NSString *)accessToken deviceToken:(nonnull NSString *)deviceToken completion:(nullable void ( ^ ) ( NSError *__nullable error ))completion

Parameters

accessToken

Twilio Access Token.

deviceToken

The push registry token for Apple VoIP Service.

completion

Callback block to receive the result of the unregistration.

Declared In

TwilioVoice.h

+ handleNotification:delegate:

Processes the incoming VoIP push notification payload.

+ (void)handleNotification:(nonnull NSDictionary *)payload delegate:(nonnull id<TVONotificationDelegate>)delegate

Parameters

payload

Push notification payload.

delegate

A TVONotificationDelegate to receive incoming call callbacks.

Declared In

TwilioVoice.h

Making Outgoing Calls

+ call:params:delegate:

Makes an outgoing call.

+ (nullable TVOCall *)call:(nonnull NSString *)accessToken params:(nullable NSDictionary<NSString*,NSString*> *)twiMLParams delegate:(nonnull id<TVOCallDelegate>)delegate

Parameters

accessToken

Twilio Access Token.

twiMLParams

Additional parameters to be passed to the TwiML application.

delegate

A TVOCallDelegate to receive call state updates.

Return Value

A TVOCall object.

Declared In

TwilioVoice.h

CallKitIntegration Methods

+ configureAudioSession

Configures, but does not activate the AVAudioSession.

+ (void)configureAudioSession

Discussion

The application needs to use this method to set up the AVAudioSession with desired configuration before letting the CallKit framework activate the audio session.

Declared In

TwilioVoice.h

+ startAudio

Starts the audio device.

+ (void)startAudio

Discussion

The application needs to use this method to signal the SDK to start audio I/O units when receiving the audio activation callback of CXProviderDelegate.

Declared In

TwilioVoice.h

+ stopAudio

Stops the audio device.

+ (void)stopAudio

Discussion

The application needs to use this method to signal the SDK to stop audio I/O units when receiving the deactivation or reset callbacks of CXProviderDelegate.

Declared In

TwilioVoice.h