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:)
.
Relationships
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(channelKey:completionHandler:)
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
Name | Type | Description |
---|---|---|
channelKey | String |
The key of your Messaging iOS channel |
completionHandler | ((Result<Messaging, MessagingError>) -> Void)? |
A block that takes a |
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
.
messagingViewController()
@objc public func messagingViewController() -> UIViewController
Returns a view controller with messaging initialized.
Returns
A UIViewController
instance
initialize(channelKey:completionHandler:)
@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
Name | Type | Description |
---|---|---|
channelKey | String |
The key of your Messaging iOS channel |
completionHandler | ((Messaging?, Error?) -> Void)? |
A block that takes a |