TalkSDK-1.0.0 Documentation Beta

Class Talk

@objc(ZDKTalk) final public class Talk: NSObject

An entry point into Talk SDK for iOS.

Talk Talk TalkScreenProvider TalkScreenProvider Talk->TalkScreenProvider TalkCoreProvider TalkCoreProvider Talk->TalkCoreProvider TalkFlowProvider TalkFlowProvider Talk->TalkFlowProvider NSObject NSObject Talk->NSObject

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

start​Call(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

digital​Line Digital​Line

name of digital line configured by the admin in Talk Settings

make​Call​Configuration​View​Controller(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

digital​Line 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.

make​Call​View​Controller(with:​call​Did​Finish​Handler:​)

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

call​Data Call​Data

Data containing all required call parameters such as DigitaLine and RecordingConsentAnswer.

call​Did​Finish​Handler @escaping (Call​Screen​View​Controller, Call​Summary) -> Void

Handler called when the call is finished with CallScreen and CallSummary as parameters. Is called for both success and failure scenarios.

Returns

CallScreenViewController, which is a CallScreen conforming UIViewController, with all configured UI and logic for making a call.

line​Status(digital​Line:​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

digital​Line Digital​Line

name of digital line configured by the admin in Talk Settings

completion @escaping (Result<Line​Status, Agent​Status​Error>) -> Void

return Result with LineStatus for success status or LineStatusError for failure.

call(call​Data:​status​Change​Handler:​)

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

call​Data Call​Data

Details for the call which contain digitalLine and recordingConsentAnswer

status​Change​Handler @escaping Status​Change​Handler

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.

line​Status(digital​Line:​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

digital​Line Digital​Line

name of digital line configured by the admin in Talk Settings

completion @escaping (Line​Status?, NSError?) -> Void

return Result with LineStatus for success status or NSError for fail.

call(call​Data:​status​Change​Handler:​)

@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

call​Data Call​Data

Details for the call which contain digitalLine and recordingConsentAnswer

status​Change​Handler @escaping (Call​Status, NSError?) -> Void

will be called on every call status change

Returns

TalkCall object where user can change DeviceOutput, mute or disconnect.

make​Call​View​Controller(with:​call​Did​Finish​Handler:​)

@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

call​Data Call​Data

Data which contains all required call details such as DigitaLine and RecordingConsentAnswer.

call​Did​Finish​Handler @escaping (_ duration:​ Time​Interval, _ 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.