public final class Bots
extends java.lang.Object
| Modifier and Type | Method and Description | 
|---|---|
static void | 
destroy()
Terminate the Bots facilities. 
 | 
static BotsConnectionStatus | 
getBotsConnectionStatus()
Accessor method for the current  
BotsConnectionStatus, or null if init(Application, Settings, BotsCallback) hasn't been called yet. | 
static Config | 
getConfig()
Accessor method for the currently connected app configuration. 
 | 
static Conversation | 
getConversation()
Accessor method for the current conversation. 
 | 
static java.lang.String | 
getFirebaseCloudMessagingProjectId()
Accessor method to get the Firebase Cloud Messaging project id that was
 linked to the application via the Web portal. 
 | 
static InitializationStatus | 
getInitializationStatus()
Accessor method for the current Initialization status. 
 | 
static LoginResult | 
getLastLoginResult()
Accessor for last known  
LoginResult or null if the user is anonymous or init(Application, Settings, BotsCallback) hasn't been called | 
static Settings | 
getSettings()
Accessor method for the SDK settings. 
 | 
static void | 
init(android.app.Application application)
Initializes Bots without settings. 
 | 
static void | 
init(android.app.Application application,
    Settings settings,
    BotsCallback callback)
Initialize the Bots SDK with the provided settings. 
 | 
static void | 
login(java.lang.String userId,
     java.lang.String jwt,
     BotsCallback callback)
Logs in a new Bots user. 
 | 
static void | 
logout(BotsCallback callback)
Logs out the current user. 
 | 
static void | 
setFirebaseCloudMessagingToken(java.lang.String token)
Method used to register the Firebase Cloud Messaging token to Bots 
 | 
static void | 
startConversation(BotsCallback callback)
Force-start a conversation for the current user 
 | 
public static void init(android.app.Application application)
init(Application, Settings, BotsCallback)
 outside of an Application class
 
 This may only be called from Application.onCreate().
application - The Applicationpublic static void init(android.app.Application application,
                        Settings settings,
                        BotsCallback callback)
 This may only be called from Application.onCreate(), unless init(Application) was called there.
 
 Use Bots.getSettings() to retrieve and modify the given settings object.
application - The Applicationsettings - The Settings to usecallback - An optional BotsCallback instance to be notified of the result.
                    Call BotsCallback.Response.getData() to check the InitializationStatusSettings, 
BotsCallback, 
BotsCallback.Response, 
InitializationStatuspublic static void login(java.lang.String userId,
                         java.lang.String jwt,
                         BotsCallback callback)
 You can either use this method to transition from logged out state to logged in, or to switch the currently logged in user to a different one.
 You may not call login while the conversation screen is shown. Doing so will result in a no-op.
 init(Application, Settings, BotsCallback) must have been called prior to calling login.
userId - The distinct id of the user to login. Must not be null.jwt - jwt used to prove the origin of the login request. Must not be null.callback - An optional BotsCallback instance to be notified of the result.
                 Call BotsCallback.Response.getData() to check the LoginResultBotsCallback, 
BotsCallback.Response, 
LoginResultpublic static void logout(BotsCallback callback)
Calling this method while in anonymous state has no effect. You may not call logout while the conversation screen is shown. Doing so will result in a no-op.
callback - An optional BotsCallback instance to be notified of the result.
                 Call BotsCallback.Response.getData() to check the LogoutResultBotsCallback, 
BotsCallback.Response, 
LogoutResultpublic static void startConversation(BotsCallback callback)
Creates a user and conversation on the server, allowing the business to reach out proactively to the user via the public API.
It is strongly recommended to only call this method in the case where a message is likely to be sent.
 This method is called automatically when starting a conversation via the Conversation.sendMessage(Message) or Conversation.uploadImage(Message, BotsCallback) methods, or when a user sends a message via the conversation activity.
 
If a conversation already exists for the current user, this call is a no-op.
callback - An optional BotsCallback instance to be notified of the result.BotsCallback, 
BotsCallback.Responsepublic static void destroy()
Bots is automatically terminated when the application exits. This method does not, usually, have to be called manually.
public static Settings getSettings()
 Use this object to update settings at run time.
 Note: Some settings may only be configured at init time. See the Settings class reference for more information.
init(Application, Settings, BotsCallback), or null if Bots hasn't been initialized yet.Settingspublic static Conversation getConversation()
Conversationpublic static Config getConfig()
Configpublic static InitializationStatus getInitializationStatus()
init(Application, Settings, BotsCallback) hasn't been called yet.InitializationStatuspublic static BotsConnectionStatus getBotsConnectionStatus()
BotsConnectionStatus, or null if init(Application, Settings, BotsCallback) hasn't been called yet.BotsConnectionStatuspublic static LoginResult getLastLoginResult()
LoginResult or null if the user is anonymous or init(Application, Settings, BotsCallback) hasn't been calledLoginResultpublic static java.lang.String getFirebaseCloudMessagingProjectId()
public static void setFirebaseCloudMessagingToken(java.lang.String token)
token - The Firebase Cloud Messaging token