VoiceSDK
public final class VoiceSDK
VoiceSDK is an SDK facade object.
The inception point of all communications between client and SDK.
-
The state refects the current SDK state. The client may adopt
VoiceSDKObserverProtocoland subscribe for changes.Declaration
Swift
public private(set) var state: State { get set } -
The configuration contains SDK settings. It should be set at least once before activation.
Declaration
Swift
public var configuration: Configuration { get set } -
The authenticationContext contains authentication token. It should be set at least once before activation.
Declaration
Swift
public var authenticationContext: AuthenticationContext { get } -
The networkReachabilityStatus refelects the current network reachability status. The client may adopt
NetworkReachabilityObserverProtocoland subscribe for changes.Declaration
Swift
public var networkReachabilityStatus: ReachabilityStatus { get } -
The calls contains active calls. The client may adopt
CallSetObserverProtocoland subscribe for changes.Declaration
Swift
public var calls: [VoiceCall] { get } -
The pushToken contains push notification token (PushKit). The client may adopt
PushNotificationObserverProtocoland subscribe for changes.Declaration
Swift
public var pushToken: String { get }
-
The
preinit()function prepares the SDK for receiving VoIP push notifications.Note
The application should call this function asap inapplication(_:didFinishLaunchingWithOptions:). But even so, it is recommended to setuplogMessageCallbackin the first place.Declaration
Swift
public class func preinit() -
The shared is a reference on a
VoiceSDKsingleton (SDK facade object).Declaration
Swift
public static let shared: VoiceSDK
-
The
activate(completion:)function creates (setup) the internal SDK components. It should be called by app on user login (autologin) completion.Declaration
Swift
public func activate(completion: @escaping (_ result: Result<Void, ErrorType>) -> Void)Parameters
completionThe completion is called on main thread.
resultIt contains the SDK activation result.
-
The
deactivate(completion:)function destroys the internal SDK components. It should be called by app upon user logout.Declaration
Swift
public func deactivate(completion: @escaping (_ result: Result<Void, ErrorType>) -> Void)Parameters
completionThe completion is called on main thread.
resultIt contains the SDK deactivation result.
-
The
placeCall(with:completion)function places outgoing call.Precondition
TheVoiceSDKobject should be inactivestate.Declaration
Swift
public func placeCall(with parameters: OutgoingCallParameters, completion: @escaping (_ result: Result<VoiceCall, ErrorType>) -> Void) -
The
updatePhoneNumber(:)function updates phone number.Declaration
Swift
public func updatePhoneNumber(_ number: String?, completion: @escaping (_ result: Result<Void, ErrorType>) -> Void)Parameters
numberIt updates (sets) the current device phone number.
completionThe completion is called on main thread.
resultThe result is either
successorfailurewithErrorTypevalue. -
The
updateInboundCallPath(:)function updates inbound call path.Declaration
Swift
public func updateInboundCallPath(_ path: InboundCallPath, completion: @escaping (_ result: Result<Void, ErrorType>) -> Void)Parameters
pathIt updates (sets) the current prefered path for receiving the incoming call on this device.
completionThe completion is called on main thread.
resultThe result is either
successorfailurewithErrorTypevalue. -
The
version()function returns Voice SDK version.Declaration
Swift
@discardableResult public func version() -> StringReturn Value
The string value indicating the Voice SDK version.
-
The
voiceStackVersion()function returns version of Voice Stack used by Voice SDK.Declaration
Swift
@discardableResult public func voiceStackVersion() -> StringReturn Value
The string value indicating the version or Voice Stack.
-
The logMessageCallback is used to route SDK log messages to client.
Declaration
Swift
public static var logMessageCallback: LogMessageCallback? { get set } -
The contactResolverCallback is used to request Contact Info from client.
Declaration
Swift
public static var contactResolverCallback: ContactResolverCallback? { get set }
-
The
addObserver(_:)function adds observer object.Note
The weak reference is stored.Precondition
In order to be notified the observer should adopt at least one the following protocols:
Declaration
Swift
public func addObserver(_ observer: AnyObject)Parameters
observerThe reference on the object.
-
The
removeObserver(_:)function removes observer object.Declaration
Swift
public func removeObserver(_ observer: AnyObject)Parameters
observerThe reference on the object.
VoiceSDK Class Reference