Class
Talk
@objc(ZDKTalk) final public class Talk: NSObject
An entry point into Talk SDK for iOS.
Relationships
Conforms To
TalkCoreProvider
Main
Talk
provider, responsible for the core calling API functionality.TalkFlowProvider
Call flow provider, responsible for effortlessly starting the call using SDK provided screens and APIs.
TalkScreenProvider
Screen provider, responsible for creating preconfigured and ready to use call configuration and call view controllers.
NSObject
Initializers
init(zendesk:)
@objc public convenience init(zendesk: Zendesk)
Initialize Talk with provided Zendesk
configuration.
Methods
startCall(to:)
@objc(startCallToDigitalLine) public func startCall(to digitalLine: DigitalLine)
Starts the call flow. All screens are presented modally.
If necessary, first configuration screen is presented where the user is asked to grant microphone access permission (if were not provided earlier) and call recording consent (if required). After appropriate permissions are granted the call screen is presented and the call with agent will be started.
Parameters
Name | Type | Description |
---|---|---|
digitalLine | DigitalLine |
name of digital line configured by the admin in Talk Settings |
makeCallConfigurationViewController(for:)
@objc public func makeCallConfigurationViewController(for digitalLine: String) -> CallConfigurationScreenViewController
Returns Call Configuration view controller
Before making a call you need to make sure user has granted all required permissions. You can use this provided view controller for checking and asking for the permissions and validating all states.
Parameters
Name | Type | Description |
---|---|---|
digitalLine | String |
A nickname of a digital line for which the configuration will be displayed. |
Returns
CallConfigurationScreenViewController
, which is a CallConfigurationScreen
conforming UIViewController
with configured components and flow.
makeCallViewController(with:callDidFinishHandler:)
public func makeCallViewController(with callData: CallData, callDidFinishHandler: @escaping (CallScreenViewController, CallSummary) -> Void) -> CallScreenViewController
Returns Call View Controller
Before showing that screen you should check microphone permission
, digital line
status, and recording consent
first.
You can use this provided view controller, with all required logic for making a call.
Parameters
Name | Type | Description |
---|---|---|
callData | CallData |
Data containing all required call parameters such as |
callDidFinishHandler | @escaping (CallScreenViewController, CallSummary) -> Void |
Handler called when the call is finished with |
Returns
CallScreenViewController
, which is a CallScreen
conforming UIViewController
, with all configured UI and logic for making a call.
lineStatus(digitalLine:completion:)
public func lineStatus(digitalLine: DigitalLine, completion: @escaping (Result<LineStatus, AgentStatusError>) -> Void)
Provides asynchronous information about the status of a digital line associated with digitalLine
name, as defined in Talk Settings.
For more information about line status, see the LineStatus
documentation.
Parameters
Name | Type | Description |
---|---|---|
digitalLine | DigitalLine |
name of digital line configured by the admin in Talk Settings |
completion | @escaping (Result<LineStatus, AgentStatusError>) -> Void |
return |
call(callData:statusChangeHandler:)
public func call(callData: CallData, statusChangeHandler: @escaping StatusChangeHandler) -> TalkCall
Initializes a call for provided call data.
After call is initialized or fails to connect a handler is called with matching result.
Parameters
Name | Type | Description |
---|---|---|
callData | CallData |
Details for the call which contain |
statusChangeHandler | @escaping StatusChangeHandler |
will be called on every call status change |
Returns
TalkCall
object representing the call, enabling to control it's various parameters as: DeviceOutput
, mute
or disconnect
.
lineStatus(digitalLine:completion:)
@available(swift, obsoleted: 1.0) @objc public func lineStatus(digitalLine: DigitalLine, completion: @escaping (LineStatus?, NSError?) -> Void)
Provides asynchronous information about status of line associated with digitalLine
in Talk Settings.
For more information about line status, see the LineStatus
documentation.
Parameters
Name | Type | Description |
---|---|---|
digitalLine | DigitalLine |
name of digital line configured by the admin in Talk Settings |
completion | @escaping (LineStatus?, NSError?) -> Void |
return |
call(callData:statusChangeHandler:)
@available(swift, obsoleted: 1.0) @objc public func call(callData: CallData, statusChangeHandler: @escaping (CallStatus, NSError?) -> Void) -> TalkCall
Initializes call with provided call data.
When call will be initialized or failed, handler will be called with proper result.
Parameters
Name | Type | Description |
---|---|---|
callData | CallData |
Details for the call which contain |
statusChangeHandler | @escaping (CallStatus, NSError?) -> Void |
will be called on every call status change |
Returns
TalkCall
object where user can change DeviceOutput
, mute
or disconnect
.
makeCallViewController(with:callDidFinishHandler:)
@available(swift, obsoleted: 1.0) @objc public func makeCallViewController(with callData: CallData, callDidFinishHandler: @escaping (_ duration: TimeInterval, _ error: NSError?) -> Void) -> UIViewController & CallScreen
Returns Call View Controller
Before showing that screen you may want to check microphone permission
, digital line
status, and recording consent
first.
You can use this already prepared view controller, with all required logic for making calls.
Parameters
Name | Type | Description |
---|---|---|
callData | CallData |
Data which contains all required call details such as |
callDidFinishHandler | @escaping (_ duration: TimeInterval, _ error: NSError?) -> Void |
Handler which will be called when the call is finished with CallScreen and CallSummary as parameters. Will be called for both success and failure scenarios. |
Returns
CallScreen
which is also UIViewController
with all configured UI and logic for making calls.