public class EPManager
This manager is the 86% SDK entry point.
Modifier and Type | Field and Description |
---|---|
static EPManager |
INSTANCE
This manager is the 86% SDK entry point.
|
static int |
apiVersion
The current EightySixPercent API version.
|
Modifier and Type | Method and Description |
---|---|
void |
clearChatConversation(android.content.Context context,
java.lang.String chatConversationId)
Clears a chat conversation and associated data.
|
void |
clearData(android.app.Application application)
Clears all chat conversations and associated data.
To be called, for example, when you log a user out.
|
void |
fragment(android.content.Context context,
EPChatConversation conversation,
kotlin.jvm.functions.Function2<? super co.eightysixpercent.bot.fragment.EPChatConversationFragment,? super java.lang.Exception,kotlin.Unit> completion)
Creates a fragment for the given chat conversation.
|
EPChatConversation |
getChatConversation(java.lang.String id)
Get an existing chat conversation for a given id.
|
boolean |
getEnableAnalytics() |
EPTimingConfiguration |
getTimingConfiguration()
Allows the customization of the timing with which the message are displayed
|
void |
init(android.app.Application application,
EPManagerInterface botCustomManagerInterface,
boolean enableLogs,
boolean enableAnalytics)
Initializes the EPManager.
It must be called in order to have the bots working.
|
boolean |
isBotRegistered(java.lang.String uuid)
Check if a bot was registered.
|
void |
refreshRegisteredBots()
Check if a new version for the registered bots is available on the server and download it
|
void |
registerBot(java.lang.String uuid,
EPBotFetchingStrategy fetchingStrategy)
Registers a new bot to the EPManager.
|
void |
restartChatConversation(android.content.Context context,
java.lang.String chatConversationId,
java.lang.String botUuid,
java.util.List<co.eightysixpercent.bot.model.EPContextObject> contextUpdate,
boolean replaceContext,
kotlin.jvm.functions.Function1<? super java.lang.Exception,kotlin.Unit> completion)
Clears a chat conversation and associated data and restart it with the now botUuid and botContext infos.
|
void |
runBotOnChatConversation(android.content.Context context,
EPChatConversation chatConversation,
java.lang.String botUuid,
java.util.List<co.eightysixpercent.bot.model.EPContextObject> contextUpdate,
boolean replaceContext,
kotlin.jvm.functions.Function1<? super java.lang.Exception,kotlin.Unit> completion)
Runs a bot on the given chat conversation.
|
void |
setEnableAnalytics(boolean p) |
public static int apiVersion
The current EightySixPercent API version.
public static EPManager INSTANCE
This manager is the 86% SDK entry point.
public boolean getEnableAnalytics()
public void setEnableAnalytics(boolean p)
public void init(android.app.Application application, EPManagerInterface botCustomManagerInterface, boolean enableLogs, boolean enableAnalytics)
Initializes the EPManager. It must be called in order to have the bots working.
application
- the application initializing the SDKbotCustomManagerInterface
- The object that will receive the EPManager events.enableLogs
- If set to true
the 86% SDK logs will be displayed in the console. Default value is false
.enableAnalytics
- If set to true
the 86% SDK will send analytics visible on the Bot Editor. Default value is true
.public EPTimingConfiguration getTimingConfiguration()
Allows the customization of the timing with which the message are displayed
public void clearChatConversation(android.content.Context context, java.lang.String chatConversationId)
Clears a chat conversation and associated data.
chatConversationId
- the id of the chat conversation you want to erasepublic void clearData(android.app.Application application)
Clears all chat conversations and associated data. To be called, for example, when you log a user out.
public void restartChatConversation(android.content.Context context, java.lang.String chatConversationId, java.lang.String botUuid, java.util.List<co.eightysixpercent.bot.model.EPContextObject> contextUpdate, boolean replaceContext, kotlin.jvm.functions.Function1<? super java.lang.Exception,kotlin.Unit> completion)
Clears a chat conversation and associated data and restart it with the now botUuid and botContext infos.
context
- the associated contextchatConversationId
- the id of the chat conversation you want to erasebotUuid
- the unique id of the bot to startcontextUpdate
- the conversation context to be updatedreplaceContext
- clear the conversation context if set to truecompletion
- called with null if everything went well else called with an errorpublic void registerBot(java.lang.String uuid, EPBotFetchingStrategy fetchingStrategy)
Registers a new bot to the EPManager.
uuid
- The UUID of the bot to register.fetchingStrategy
- The fetching strategy to use to get the bot when you're about to open a controller.public boolean isBotRegistered(java.lang.String uuid)
Check if a bot was registered.
uuid
- The UUID of the bot to register.public void refreshRegisteredBots()
Check if a new version for the registered bots is available on the server and download it
public EPChatConversation getChatConversation(java.lang.String id)
Get an existing chat conversation for a given id.
id
- The id of the existing chat conversation to get.null
if it was not found.public void fragment(android.content.Context context, EPChatConversation conversation, kotlin.jvm.functions.Function2<? super co.eightysixpercent.bot.fragment.EPChatConversationFragment,? super java.lang.Exception,kotlin.Unit> completion)
Creates a fragment for the given chat conversation.
context
- The associated context.conversation
- The chat conversation to be displayed in the fragment.completion
- Callback called when the chat conversation fragment is ready to be used.public void runBotOnChatConversation(android.content.Context context, EPChatConversation chatConversation, java.lang.String botUuid, java.util.List<co.eightysixpercent.bot.model.EPContextObject> contextUpdate, boolean replaceContext, kotlin.jvm.functions.Function1<? super java.lang.Exception,kotlin.Unit> completion)
Runs a bot on the given chat conversation.
context
- The associated context.chatConversation
- The chat conversation on which to run the bot.botUuid
- The UUID of the bot to run.contextUpdate
- A list of context objects to use to update the chat conversation context. Default value is an empty list.replaceContext
- If set to true
, the current conversation context will first be cleared before add the given context objects.completion
- Called when the bot has been started on the chat conversation.