ZendeskSDKMessaging Documentation Beta

Class Messaging

@objc(ZDKMessaging) public final class Messaging: NSObject

The entry point to execute SDK actions. To obtain an instance use Messaging.initialize(channelKey:completionHandler:).

Messaging Messaging NSObject NSObject Messaging->NSObject

Conforms To

NSObject

Properties

delegate

var delegate: MessagingDelegate?

Delegate that allows you to observe user interactions that happen in the SDK.

instance

var instance: Messaging?

The current instance of Messaging.

Returns

The current instance of Messaging if it has initialized successfully.

Methods

initialize(channel​Key:​completion​Handler:​)

public static func initialize(channelKey: String, completionHandler: ((Result<Messaging, MessagingError>) -> Void)?)

Initializes Messaging for the given channelKey. It is an asynchronous call that retrieves settings from the network that calls the completionHandler with the result.

Parameters

channel​Key String

The key of your Messaging iOS channel

completion​Handler ((Result<Messaging, Messaging​Error>) -> Void)?

A block that takes a Result enum type. In the case of a success, a Messaging instance will be returned, in the case of a failure a MessagingError .

invalidate()

@objc public static func invalidate()

Invalidates the current instace of Messaging. After calling this method you will have to call Messaging.initialize() again if you would like to use Messaging.

messaging​View​Controller()

@objc public func messagingViewController() -> UIViewController

Returns a view controller with messaging initialized.

Returns

A UIViewController instance

initialize(channel​Key:​completion​Handler:​)

@available(swift, obsoleted: 1.0) @objc static func initialize(channelKey: String, completionHandler: ((Messaging?, Error?) -> Void)?)

Initializes Messaging for the given channelKey. It is an asynchronous call that retrieves settings from the network that calls the completionHandler with the result.

Parameters

channel​Key String

The key of your Messaging iOS channel

completion​Handler ((Messaging?, Error?) -> Void)?

A block that takes a Result enum type. In the case of a success, a Messaging instance will be returned, in the case of a failure a MessagingError .