TwilioVoice Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | TwilioVoice.h |
Overview
TwilioVoice is the entry point to the Twilio Voice SDK. You can register for VoIP push notifications, make outgoing
Calls, receive CallInvites and audio device assignment using this class.
CallKit Audio Session Handling
Other Methods
logLevel
The current logging level used by the SDK.
@property (nonatomic, assign, class) TVOLogLevel logLevelDiscussion
The default logging level is TVOLogLevelError. TwilioVoice and its components use NSLog internally.
See Also
Declared In
TwilioVoice.h
region
Defines the region (Twilio data center) used for media and signaling traffic.
@property (nonatomic, copy, nonnull, class) NSString *regionDiscussion
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
audioDevice
The TVOAudioDevice used to record and playback audio in a Call.
@property (class, nonatomic, strong, nonnull) id<TVOAudioDevice> audioDeviceDiscussion
If you wish to provide your own TVOAudioDevice then you must set it before performing any other
actions with the SDK like connecting to a Call. It is also possible to change the device when you are no longer
connected to any Calls and have destroyed all other SDK objects.
See Also
Declared In
TwilioVoice.h
+ sdkVersion
Returns the version of the SDK.
+ (nonnull NSString *)sdkVersionReturn Value
The version of the SDK.
Declared In
TwilioVoice.h
+ setLogLevel:module:
Sets the logging level for an individual module.
+ (void)setLogLevel:(TVOLogLevel)logLevel module:(TVOLogModule)moduleParameters
logLevel |
The |
|---|---|
module |
The |
See Also
Declared In
TwilioVoice.h
+ logLevelForModule:
Retrieve the log level for a specific module in the TwilioVoice SDK.
+ (TVOLogLevel)logLevelForModule:(TVOLogModule)moduleParameters
module |
The |
|---|
Return Value
The current log level for the specified 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 ))completionParameters
accessToken |
Twilio Access Token. |
|---|---|
deviceToken |
The push registry token for Apple VoIP Service. |
completion |
Callback block to receive the result of the registration. |
Discussion
Registering for push notifications is required to receive incoming Calls through Twilio’s infrastructure. Once you’ve successfully registered it’s not necessary to do so again unless your device token changes.
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 ))completionParameters
accessToken |
Twilio Access Token. |
|---|---|
deviceToken |
The push registry token for Apple VoIP Service. |
completion |
Callback block to receive the result of the unregistration. |
Discussion
Call this method when you no longer want to receive push notifications for incoming Calls. If your device token changes you should call this method to unregister your previous invalid token.
Declared In
TwilioVoice.h
+ handleNotification:delegate:
Processes an incoming VoIP push notification payload.
+ (void)handleNotification:(nonnull NSDictionary *)payload delegate:(nonnull id<TVONotificationDelegate>)delegateParameters
payload |
Push notification payload. |
|---|---|
delegate |
A |
Discussion
This method will asynchronously process your notification payload and call the provided delegate on the main dispatch queue.
See Also
Declared In
TwilioVoice.h
+ connectWithAccessToken:delegate:
Connect an outgoing Call.
+ (nonnull TVOCall *)connectWithAccessToken:(nonnull NSString *)accessToken delegate:(nonnull id<TVOCallDelegate>)delegateParameters
accessToken |
The access token. |
|---|---|
delegate |
A |
Return Value
A TVOCall object.
Discussion
This method is guaranteed to return a TVOCall object. It’s possible for the returned Call to either
succeed or fail to connect.
See Also
Declared In
TwilioVoice.h
+ connectWithOptions:delegate:
Connect an outgoing Call.
+ (nonnull TVOCall *)connectWithOptions:(nonnull TVOConnectOptions *)options delegate:(nonnull id<TVOCallDelegate>)delegateParameters
options |
The connect options. |
|---|---|
delegate |
A |
Return Value
A TVOCall object.
Discussion
This method is guaranteed to return a TVOCall object. It’s possible for the returned Call to either
succeed or fail to connect. Use the TVOConnectOptions builder to specify Call parameters and UUID
See Also
Declared In
TwilioVoice.h