API Reference
Chatvisor.init(...)
/**
* Initializes the Chatvisor SDK.
*
* @param tenantId tenant id
* @param token token
*/
@depricated
static void init(String tenantId, String token)
/**
* Initializes the Chatvisor SDK with custom configuration.
*
* @param config custom configuration object containing
* tenantId, token, serverUrl and cdnServerUrl
*/
static void init(CustomConfiguration config)
```java
/**
* Setups the shared session
*
* @param list white list containing package names of all apps that want to join a shared session
* @param ownPackageName package name of own app
*/
static void setUpSharedSession(ArrayList<String> list, String ownPackageName)
Chatvisor.coBrowsing
Start session
/**
* Starts a CoBrowsing session using the supplied user id and token
*/
@depricated
void start()
/**
* Starts a CoBrowsing session using the supplied user id and token
*/
void start(ResultCallback<String> callback)
Join existing session
/**
Joins existing session
- @param session SharedSession
- @param success: shareId: String or failure: Error
*/
void join(SharedSession session, ResultCallback<String> callback)
Stop session
/**
* Disconnects the current session.
*/
void stop()
Chatvisor.liveView
Start session
/**
* Starts a LiveView session using the supplied user id and token
*/
@depricated
void start()
/**
* Starts a LiveView session using the supplied user id and token
* @param callback returns the sessionId on Success
*/
void start(ResultCallback<String> callback)
Join existing session
/**
Joins existing session
- @param session SharedSession
- @param success: shareId: String or failure: Error
*/
void join(SharedSession session, ResultCallback<String> callback)
Stop session
/**
* Disconnects the current session.
*/
void stop()
Connection status
/**
* Returns the current connection status. True if a session was started and server was reached.
* Use .addOnPropertyChangedCallback(connectionCallback) to get a callback when the connectionstate changes
*
* @return true if connected
*/
ObservableBoolean isConnectedWithCallback()
/**
* Returns the current connection status. True if a session was started and server was reached.
*
* @return true if connected
*/
@depricated
boolean isConnected()
Tag session
/**
* Tags the current active session with a custom string value
*
* @param tagName Tag name as string
*/
@depricated
void tag(String tag)
/**
* Tags the current active session with a custom string value
*
* @param tagName Tag name as string
* @param callback Tag callback
*/
void tag(String tag, ResultCallback<String> callback)
Register callbacks
/**
* Registers callback for start and stop
*
* @param startCallback Called when session is started by remote server
* @param stopCallback Called when session is stoped by remote server
*/
void registerCallbacks(Runnable startCallback, Runnable stopCallback)
Get share Id
/**
* Returns the share Id to identify the session
*
* @return returns the shareId
*/
String getShareId()
/**
Returns a Co-Browsing SharedSession instance if one exists within all apps,
that has access to the content providers of each other, or null.
setUpSharedSession must be called and sessionSharingEnabled in ApplicationConfig
must be set to true to enable this functionality.
Sessions are saved into each content provider of the apps that are allowed
to do so (via setUpSharedSession) and are then shared when a Co-Browsing session
starts and deleted when a session ends (by app or via engage).
*/
SharedSession sharedSession()
SharedSession
// Shared session descriptor object
/**
- Shared session ID.
*/
String sessionId
/**
- Share ID. User / operator friendly version of sessionId
*/
String shareId
/**
- Package name of the session initiator app
*/
String initiatorApplicationId
/**
* State of the session
*/
SessionState sessionState
enum SessionState {
ONGOING,
STOPPED
}
Chatvisor.webChat
Show chat
/**
* Opens a WebChat overlay
*
* @param configuration WebChat configuration object
*/
@depricated
void open(String tenantId)
/**
* Opens a WebChat overlay
*
* @param callback WebChat callback
*/
void open(ResultCallback<String> callback)
Initialize chatvisor chat notifications
/**
* Initializes chatvisor chat notifications
* @param context application context
*/
public void initNotifications(Context context)
/**
* Initializes chatvisor chat notifications with a custom Firebase project
* (For on-premise installations)
* The parameters can be found in the google-services.json file of the firebase project.
* @param context application context
* @param projectId Firebase project id
* @param applicationId Firebase application id
* @param apiKey Firebase api key
* @param senderId Firebase sender id
*/
public void initNotifications(Context context, String projectId, String applicationId, String apiKey, String senderId)
Prevent the user from receiving notifications
/**
* Destroy current notification token. This will prevent the app from receiving notifications
* until the user is tagged again.
*/
public void destroyNotificationToken()
ChatvisorNotificationService
/**
* Call this method when a chatvisor notification is received.
* @param remoteMessage the received message
*/
void onMessageReceived(@NonNull RemoteMessage remoteMessage)
/**
* Call this method when a new token is received.
* @param token the new token
*/
void onNewToken(String token)
/**
* Deletes all chatvisor chat notifications.
* Is called when the user opens the chatvisor chat.
* @param context
*/
static void clearChatNotifications(Context context)
Chatvisor.user
Tag user
/**
* Tags the current or any following session with the given user information until clear() is called
*/
@depricated
void tag(ActiveUser user)
/**
* Tags the current or any following session with the given user information until clear() is called
* @param callback tagUser callback
*/
void tag(ActiveUser user, ResultCallback<String> callback)
Clear tagged user
/**
* Clears a user tag
*/
void clear()
Chatvisor.conference
Start conference
Use the following method to start a video conference in the app.
/**
* Use this method to start a video conference in the app.
*
* @param context application context
* @param properties conference properties with customer id.
*/
@depricated
void start(Context context, ConferenceProperties properties)
/**
* Use this method to start a video conference in the app.
*
* @param context application context
* @param properties conference properties with customer id.
* @param callback conference callback
*/
void start(Context context, ConferenceProperties properties, ResultCallback<Boolean> callback)
/**
* Use this method to start a video conference in the app and show an
* invitation dialog.
*
* @param context application context
* @param properties conference properties with customer id
* @param showInviteDialog shows the default invite dialog
*/
@depricated
public void start(Context context, ConferenceProperties properties, Boolean showInviteDialog)
/**
* Use this method to start a video conference in the app and show an
* invitation dialog.
*
* @param context application context
* @param properties conference properties with customer id
* @param showInviteDialog shows the default invite dialog
* @param showInviteDialog conference callback
*/
public void start(Context context, ConferenceProperties properties, Boolean showInviteDialog, ResultCallback<Boolean> callback)
Join conference queue
This is useful if want to use a waiting queue before the customer can start the conference. The customer joins the conference queue but he has to wait unit he gets assigned to an agent. Use the queueStatus callback to get updates about the position in the queue and start the conference.
/**
* Joins the waiting queue for a conference
*
* @param context application context
* @param properties conference properties with customer id.
*/
@depricated
void join(Context context, ConferenceProperties properties)
/**
* Joins the waiting queue for a conference
*
* @param context application context
* @param properties conference properties with customer id.
* @param callback conference callback
*/
void join(Context context, ConferenceProperties properties, ResultCallback<Boolean> callback)
Check queue status
Check the queue status of the current customer which has joined the conference before. When the queue status is -1 an agent picked up the user. Each subsequent call to queueStatus with the same customerId will replace the callback.
/**
* Sets a callback for queue status polling.
* After joining the queue the callback is called every few seconds with the position in the queue.
* When the position is -1, the conference should be started by calling start(...)
*
* @param callback callback
*/
void queueStatus(Consumer<Integer> callback)