EPManager
public class EPManager : NSObject
This manager is the 86% SDK entry point.
-
If set to
trueit enables EightySixPercent logging.Declaration
Swift
public var enableLogs: Bool -
If set to
trueit enables analytics sending to the Bot Editor.Declaration
Swift
public var enableAnalytics: Bool -
The current EightySixPercent API version.
Declaration
Swift
public var apiVersion: Int
-
Initializes the EPManager. It must be called in order to have the bots working.
Declaration
Swift
public func initialize(delegate: EPManagerDelegate? = nil, enableLogs: Bool = false, enableAnalytics: Bool = true)Parameters
delegateThe object that will receive the EPManager events.
enableLogsIf set to
truethe 86% SDK logs will be displayed in the console. Default value isfalse.enableAnalyticsIf set to
truethe 86% SDK will send analytics visible on the Bot Editor. Default value istrue. -
Clears all chat conversations and associated data. To be called, for example, when you log a user out.
Declaration
Swift
public func clearData()
-
Registers a new bot to the EPManager.
Declaration
Swift
public func registerBot(uuid: String, fetchingStrategy: EPBotFetchingStrategy)Parameters
uuidThe UUID of the bot to register.
fetchingStrategyThe fetching strategy to use to get the bot when you’re about to open a controller.
-
Creates a view controller for the given chat conversation and appearance.
Declaration
Swift
public func controller(for conversation: EPChatConversation, appearance: EPAppearance , delegate: EPChatMessageViewControllerDelegate? = nil, completion: @escaping (_ controller: EPChatMessageViewController?, _ error: Error?) -> ())Parameters
conversationThe chat conversation to display in the controller.
appearanceThe appearance to use with this controller. Default value is
nil.delegateThe delegate to use for the controller provided in the callback. Default value is
nil.completionCallback called when the chat conversation controller is ready to be used.
controllerThe controller that has been initialized for the given chat conversation and appearance,
nilif an error occurred. (optional)errorThe error that happened preparing the conversation and/or the controller,
nilif no errors were raised. (optional)
-
Get an existing chat conversation for a given id.
Declaration
Swift
public func getChatConversation(forId id: String) -> EPChatConversation?Parameters
idThe id of the existing chat conversation to get.
Return Value
The matching chat conversation object or
nilif it was not found.
-
Runs a bot on the given chat conversation.
Declaration
Swift
public func runBotOnChatConversation(chatConversation: EPChatConversation, botUuid: String, contextUpdate: [EPContextObject] = [], replaceContext: Bool = false, completion: @escaping (_ error: Error?) -> ())Parameters
chatConversationThe chat conversation on which to run the bot.
botUuidThe UUID of the bot to run.
contextUpdateAn array of context objects to use to update the chat conversation context. Default value is
[].replaceContextIf set to
true, the current conversation context will first be cleared before add the given context objects.completionCalled when the bot has been started on the chat conversation.
errorThe error that occurred when trying to start the bot.
EPManager Class Reference