This use case describes example steps of the configuration and API usage which are needed to help logged in users in an mobile application.
For the detailled API documentation see the Android and iOS API docs.
This guide will describe the steps with code for Android, but the general steps are applicable to an iOS application in the same way
Open the web application and create a "CoBrowsing/Analytics" plugin. To make the screen transmission only start when a user needs help, configure an opt-in type. For this use case, we recommend selecting "Support Agent". To ask the user for permission before the screen transmission starts, change to the "Co-Browsing" tab and enable "Activate Co-Browsing" and "Additional option popup when Co-Browsing is started".
The mobile SDK has to be integrated into the application package.
Learn how to integrate the SDK into your Android application
Once the application is started by a user, the LiveView module of the SDK should be started. This will register a session in the Chatvisor Webservice, but not start screen transmission if you enabled opt-in in the previous step.
For instance in the onCreate
method of your application class call the the start
method with the mobile credentials found on the API settings page:
Chatvisor.liveView.start("<your user id>", "<your token>");
You should now see an session in the LiveView session list:
Once a user logs into a user account in the application, we want to tag the session with information about the user. Make sure to use the username or any unique value for the id field, so a new user is created in the backend that has all sessions associated with it.
List<String> labels = new ArrayList<String>(); labels.put("foo") Chatvisor.user.tag( new ActiveUser() .widthId("john.doe") .withEmail("[email protected]") .withFirstname("John") .withLastname("Doe") .withLabels(labels) );
The session list should now look like this. Notice the tags added to the session.
If a user logs out of your application, call the clear method to remove the tag associated with the session:
Chatvisor.user.clear()
We now assume that the user contacted you e.g. by telephone. You may now open the list of sessions and look for the username john.doe
. After clicking the session, a button appears to ask the user to accept the request. Once the user accepts the request, the screen of the mobile device is shown.