VoiceClient Class Reference

Inherits from NSObject
Declared in VoiceClient.h

Overview

  • The VoiceClient 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) TVOLogLevel logLevel

Discussion

Logging level of the SDK.

See Also

Declared In

VoiceClient.h

  publishMetricsEnabled

Call quality metrics publishing. YES to enable. NO to disable.

@property (nonatomic, assign, getter=isPublishMetricsEnabled) BOOL publishMetricsEnabled

Discussion

Call quality metrics publishing. YES to enable. NO to disable.

Declared In

VoiceClient.h

+ sharedInstance

Returns the shared instance of the VoiceClient.

+ (nonnull VoiceClient *)sharedInstance

Return Value

The shared instance of the VoiceClient

Discussion

Returns the shared instance of the VoiceClient.

Declared In

VoiceClient.h

– version

Returns the version of the SDK.

- (nonnull NSString *)version

Return Value

The version of the SDK.

Discussion

Returns the version of the SDK.

Declared In

VoiceClient.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.

Discussion

Sets logging level for an individual module.

Declared In

VoiceClient.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.

Discussion

Registers for Twilio VoIP push notifications.

Declared In

VoiceClient.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.

Discussion

Unregisters from Twilio VoIP push notifications.

Declared In

VoiceClient.h

– handleNotification:delegate:

Processes the incoming VoIP push notification payload.

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

Parameters

payload

Push notification payload.

delegate

A TVONotificationDelegate to receive incoming call callbacks.

Discussion

Processes the incoming VoIP push notification payload.

Declared In

VoiceClient.h

Making Outgoing Calls

– call:params:delegate:

Makes an outgoing call.

- (nullable TVOOutgoingCall *)call:(nonnull NSString *)accessToken params:(nullable NSDictionary<NSString*,NSString*> *)twiMLParams delegate:(nullable id<TVOOutgoingCallDelegate>)delegate

Parameters

accessToken

Twilio Access Token.

twiMLParams

Additional parameters to be passed to the TwiML application.

delegate

A TVOOutgoingCallDelegate to receive call state updates.

Return Value

A TVOOutgoingCall object.

Discussion

Makes an outgoing call.

Declared In

VoiceClient.h

CallKitIntegration Methods

– configureAudioSession

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

- (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

VoiceClient.h

– startAudioDevice

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.

- (void)startAudioDevice

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

VoiceClient.h

– stopAudioDevice

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.

- (void)stopAudioDevice

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

VoiceClient.h