LA Android Developer Guide
LA Android Developer Guide
Updated: 2022-06-22
Contact Information
Fusion Live Assist provides voice and video calling from a consumer to an agent, along with
co-browsing, and document push by the agent, and remote control and annotation of the
consumer’s screen by the agent. See the CBA Live Assist Overview and Installation Guide
for details of what that means in practice.
For ease of integration and development, Fusion Live Assist uses the Fusion Client SDK for
voice and video support, while exposing a simple API for co-browsing. When developing using
the CBA Live Assist SDK, you use the Fusion Client SDK to set up the call, and the CBA Live
Assist SDK for co-browsing. You therefore need at least a basic understanding of the Fusion
Client SDK in order to develop using CBA Live Assist (see the FCSDK Developer Guide).
This Developer Guide gives information on integrating the Fusion Live Assist SDK into an
Android application, and how to use it to provide the co-browsing functions to a consumer.
Once you have an Android project, with its standard directory structure, you need to add the
appropriate files from the CBA Live Assist Android SDK zip file. The zip file contains the
following components that developers must integrate into their application in order to use CBA
Live Assist:
Component Description
assets
Copy the contents of this folder into the matching assets directory of the
application.
libs
Copy the assist-android-sdk1.x.x.jar file, fusionclient-android-sdkx.x.x.jar
file, and armeabi-v7a folder into the application’s libs build directory.
A folder containing resources needed by the SDK for the user interface.
res
Copy the contents of this folder into the matching res directory of the
application build directory.
AndroidManifest Entries
The CBA Live Assist SDK requires entries within the application’s AndroidManifest.xml. You
need to add these if they are not there already:
<uses-feature android:name=”android.feature.CAMERA”
android:required=”true” android:glEsVersion=”0x00020000”/>
<uses-feature android:name=”android.hardware.camera.autofocus”/>
Again under the root <manifest> element, add the following entries to enable these
permissions:
<uses-permission android:name=”android.permission.INTERNET”/>
<uses-permission android:name=”android.permission.RECORD_AUDIO”/>
<uses-permission android:name=”android.permission.CAMERA”/>
<uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”/>
<uses-permission android:name=”android.permission.MODIFY_AUDIO_SETTINGS”/>
<uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE”/>
<uses-permission android:name=”android.permission.WAKE_LOCK”/>
<uses-permission android:name=”android.permission.SYSTEM_ALERT_WINDOW”/>
<service android:name=”com.alicecallsbob.assist.sdk.core.AssistService”/>
You may want to add, under the <application> element, the following meta-data entries:
These entries act as defaults for values which CBA Live Assist needs to be present, but which
you normally set using the application’s shared preferences, or by providing a serverHost value
to the configuration object when starting a CBA Live Assist session (see the The
AssistConfigBuilder section).
In order to take advantage of CBA Live Assist functions, subclass the AssistApplicationImpl
object, and make that class the main application class of your application:
package com.example;
import com.alicecallsbob.assist.sdk.core;
<application android:label="@string/assist_app"
android:name="com.example.SampleAssistApplication"
android:icon="@drawable/launcher_icon"
android:theme="@android:style/Theme.Holo.Light">
</application>
Implementing AssistApplication
If you are integrating CBA Live Assist with an existing application, you may have an existing
application class which extends an Application class from another library. In this case you will not
be able to extend AssistApplicationImpl. In these circumstances, you should make your existing
application class implement the AssistApplication interface. To follow this pattern, the application
should construct and terminate an AssistCoreImpl object within the lifecycle of your application:
import android.app.Application;
import com.alicecallsbob.assist.sdk.core.AssistApplication;
import com.alicecallsbob.assist.sdk.core.AssistCore;
import com.alicecallsbob.assist.sdk.core.AssistCoreImpl;
@Override
public void onTerminate()
{
assistCore.terminate();
assistCore = null;
}
@Override
public AssistCore getAssistCore()
{
return assistCore;
}
}
The application typically starts a CBA Live Assist support session in one of its Activity classes;
often, though not necessarily, its main Activity. This may be in response to user interaction (user
presses a Help button), or automatically by the program in certain circumstances (the user has
entered syntactically incorrect data into a form field, for instance). You do this using the
Assist.startSupport static call.
When you call startSupport, you provide an AssistConfig configuration item, the Application
object for the current application, and an AssistListener object which receives notification when
the support session ends.
It also contains a deprecated method, onSupportError - we recommend that this should be given
no more than a skeleton implementation; to receive notifications of support errors, implement an
AssistErrorListener, and include it in the AssistConfig object (see the AssistErrorListener
section).
The AssistConfig object supplies the configuration for the CBA Live Assist session. The
recommended way to construct it is to use the AssistConfigBuilder class (see the The
AssistConfigBuilder section).
The agent may end the support session, or the application may end the session by calling
Assist.endSupport. In both cases, the CBA Live Assist SDK removes the user interface
elements which it added, and calls the onSupportEnded notification; the application only needs
to restore changes which it itself has made.
The AssistConfigBuilder
Value of the
Base URL of CBA Live Assist server and
assist-host
FCSDK Gateway, including only the
key in the
hostname, or IP address. If not set using
setServerHost application’s
setServerHost, this value must be set in the
shared
application’s shared preferences or
preferences
metadata for CBA Live Assist to work.
or meta data.
●voice only.
Shows an
Supply an AssistSharedDocumentAuth
AlertDialog
implementation that is notified when the
prompting
agent shares a document with the
the user to
setSharedDocument consumer. Allows the application to accept
choose
AuthHandler or reject a document.
whether to
accept or
See the AssistSharedDocumentAuth
reject a
section.
document
Supply an
AssistSharedDocumentReceivedListener
implementation that is notified about
successful and unsuccessful incoming
shared documents. Also handles document
setSharedDocument closure notifications, and provides an API
ReceivedListener for programmatically closing currently
opened documents.
See the
AssistSharedDocumentReceivedListener
section.
An implementation of AssistErrorListener
used for listening to errors from the CBA
Live Assist SDK.
setErrorListener
Supply an AssistAnnotationListener
implementation that is notified when an
annotation is drawn on the consumer
application, and when annotations are
setAssistAnnotation
cleared. It also allows the client to receive
Listener
an AnnotationContext that they can use to
manually clear annotations.
Shows an
AlertDialog Supply an AssistCobrowseAuthListener
prompting implementation that is notified when the
the user to agent requests co-browse with the
choose consumer. Allows the application to accept
setCobrowseAuthListener
whether to or reject the co-browse request.
accept or
reject the co See the AssistCobrowseAuthListener
browse section.
request
An implementation of the
AssistAgentCobrowseListener which
receives notifications when an agent joins,
setAgentCobrowseListener leaves, or requests to join the session.
An implementation of the
ConnectionStatusListener which will receive
setConnectionStatus notifications about the state of the
Listener connection to the CBA Live Assist server.
In most cases, the application calls startSupport with an agent name, and allows CBA Live
Assist to set up a call to the agent and implicitly add CBA Live Assist support to that call.
However, there may be cases where a call to an agent already exists, and the application needs
to add CBA Live Assist support capabilities. To do this, you need to supply the session token
and a correlation ID in the AssistConfig which you supply to startSupport; and the agent needs
to connect to the same session. The CBA Live Assist server provides some support for doing
this:
2. The application uses the short code in another call to a URL on the CBA Live Assist server,
and receives a JSON object containing a session token and a correlation ID:
3. The application passes those values to the AssistConfigBuilder, and passes the AssistConfig
object to startSupport:
Assist.startSupport(builder.build, getApplication(),
new EndSupportListener());
}
}
4. The agent uses the same short code to get a JSON object containing the session token and
correlation ID, which it then uses to connect to the same CBA Live Assist support session
(see the CBA Live Assist Agent Console Developer Guide). Informing the agent of the
short code is a matter for the application. It could be something as simple as having it
displayed on the consumer’s screen and having the consumer read it to the agent on the
existing call (this is how the sample application does it).
Note:
The short code expires after 5 minutes, or when it has been used by both agent and
consumer to connect to the same session.
If you wish to define an audit name to identify the consumer in event logs (see the CBA Live
Assist Overview and Installation Guide for more details on event logging), include an
auditName parameter in the URL which creates the short code:
/assistserver/shortcode/create?auditName=consumer
The CBA Live Assist SDK includes a file, proguard-project.txt, that can be used or merged with
an existing ProGuard configuration file for an application; copy the proguard-project.txt to the
root of the application project, alongside the project.properties file.
Typically, the project.properties of the application should specify both the local and parent
ProGuard configuration files. For example:
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
You can modify the proguard-project.txt configuration to add additional ProGuard rules as
necessary.
Note: If you are building with only co-browsing support (because your application does not
support voice and video calling; see the Using CBA Live Assist without Voice and Video section),
you should ignore the CSDK files which would otherwise be referenced in the build.
Accept an agent into, or expel the agent from, the co-browsing session
Receive an annotation (a piece of text or drawing to show on the device’s screen, overlaid
on the application’s view) from the agent
Actions which are initiated by the application (such as pushing a document to the agent) require
it to call one of the methods on the Assist object.
Actions initiated by the agent (such as annotating the consumer’s screen) can in general be
allowed to proceed without interference from the application, as the CBA Live Assist SDK
manages them, overlaying the user’s screen with its own user interface where necessary.
However, the application can receive notifications of these events by implementing of one of the
various Listener interfaces (see the Receiving Notifications section).
Receiving Notifications
You can receive notifications of events of interest on the various Listener interfaces which you
can set in the AssistConfig object which is passed to the Assist.startSupport method. In most
cases you can ignore these interfaces, but if you need to receive any of these notifications, you
need to implement the appropriate interface in some class, and pass an instance of that class in
the configuration (see the The AssistConfigBuilder section).
AssistAgentCobrowseListener
agentJoinedSession(agent)
This callback indicates that an agent has answered the support call and joined the support
session; this occurs before the agent either requests or initiates co-browsing. The callback
allows the developer to pre-approve the agent into the co-browse, before the agent makes the
request.
agentRequestedCobrowse(agent)
This callback notifies the application that the agent has specifically requested to co-browse.
There is no specific requirement for the application to allow or disallow co-browsing at this point,
but it is an obvious point to do so.
agentJoinedCobrowse(agent)
This callback occurs when the agent joins the co-browse session.
agentLeftCobrowse(agent)
This callback occurs when the agent leaves the co-browse session, and can no longer see the
consumer’s screen. Leaving the co-browse also resets the agent’s co-browse permission; the
agent may subsequently request co-browse access again.
agentLeftSession(agent)
This callback notifies the application that the agent has left the overall support session.
The default implementation displays a dialog box on the consumer’s device, asking whether to
allow co-browsing or not. If the consumer allows co-browsing, it allows any agent into the co-
browsing session whenever they request it. Implementing this interface can give the application
more control over which agents are allowed into the co-browsing session, and when.
AssistSharedDocumentAuth
The com.alicecallsbob.assist.sdk.config.impl.AssistSharedDocumentAuth interface gives the
application notification when an agent pushes a document or URI to the consumer. It has a
single method:
handleSharedDocumentAuth(AssistSharedDocumentAuthEvent)
By default, CBA Live Assist displays a dialog box, allowing the user to accept or reject the
document. You might implement this interface to automatically accept any document.
AssistSharedDocumentReceivedListener
onDocumentReceived(AssistSharedDocument)
Indicates that the document has been received and displayed. The
com.alicecallsbob.assist.sdk.core.AssistSharedDocument object gives access to the document’s
ID, its metadata (extra information supplied by the agent in the form of a String), and a close
method.
onError(AssistSharedDocument)
Indicates that the SDK cannot display the document; by default, it displays a error overlay to
inform the user.
onDocumentClosed(AssistSharedDocumentClosedEvent)
Indicates that a document has been closed. You can retrieve the AssistSharedDocuement object,
and an indication of the source of the document, using methods on the
com.alicecallsbob.assist.sdk.core.AssistSharedDocumentClosedEvent.
By default, the CBA Live Assist SDK displays the document. Acceptable document types are:
PDF, and the image formats GIF, PNG, and JPG/JPEG.
AssistAnnotationListener
The com.alicecallsbob.assist.sdk.config.impl.AssistAnnotationListener allows the client
application to receive notifications relating to annotations sent by the agent:
newAnnotation(annotation, sourceName)
annotationContextInitialised(AnnotationContext)
annotationContextEnded(AnnotationContext)
Notification that the AnnotationContext is no longer valid and should not be used.
You can implement this interface in order to control of the display and clearing of annotations
which the application receives from the agent. See the Annotations section for details of how you
might use these notifications.
AssistCobrowseListener
The com.alicecallsbob.assist.sdk.config.impl.AssistCobrowseListener contains two notifications,
onCobrowseActive and onCobrowseInactive, which allow the application to receive notifications
when co-browsing starts and stops. You might implement this to customize the display of a
notification to the user. See the Co-browsing Visual Indicator section for details.
AssistCobrowseAuthListener
onCobrowseRequested(AssistCobrowseAuthEvent)
By default, CBA Live Assist displays a dialog box when an agent requests co-browsing,
allowing the user to accept or reject the co-browse. You might implement this interface to avoid
asking the user each time, and instead use the application’s shared preferences setting to
decide whether to accept or reject the co-browse.
ConnectionStatusListener
onConnect()
Received when the WebSocket becomes connected to the CBA Live Assist server, so that the
application can send and receive messages.
Note: The application does not need to wait to receive this notification before it can use the CBA
Live Assist API methods.
onDisconnect(reason, connector)
Received when the WebSocket connection to the CBA Live Assist server has been lost, or has
failed to reconnect. The reason is a
com.alicecallsbob.assist.sdk.transport.websocket.WebSocketException.
onTerminated(reason)
Received when the WebSocket connection with the CBA Live Assist server has terminated, and
there will be no more reconnection attempts. The reason is a WebSocketException.
to log the connection attempts and other messages to somewhere other than the default
Android log.
to implement your own reconnection strategy which is not covered by setting the
ConnectionProfile. See the Using the ConnectionStatusListener interface section for details
of how you might use an implementation of this interface.
AssistErrorListener
Code Meaning
You may wish to remove a specific agent from the co-browsing session. To do this, call:
Assist.disallowCobrowseForAgent(agent);
Assist.allowCobrowseForAgent(agent);
When the application calls allowCobrowseForAgent, the specified agent joins the co-browse
session immediately.
6. The consumer application has logic that decides the agent is allowed access to the co-
browse. This logic could be based on permissions.
3. Consumer application checks the agent permissions, and finds they do not have the
required permissions to view the current part of the application.
4. Consumer application rejects the agent’s request to join the co-browse, and the agent is
unable to see the consumer’s screen.
The application can temporarily pause a co-browse session with the agent by calling:
Assist.pauseCobrowse();
While paused, the connection to the CBA Live Assist server remains open, but the co-browse
session is disabled, disabling annotations, document sharing, and so on as a consequence.
When the application wishes to resume the co-browsing session, it should call:
Assist.resumeCobrowse();
When the application pauses a co-browse, CBA Live Assist notifies the Agent Console, which
can present a notification or message to the agent to indicate what has happened.
Sharing Documents
Note: Sharing a document does not actually send the document to the agent, but simply displays
the document on the local device, so that both the consumer and the agent can see and co-
browse the document.
This method allows sharing a document given its URL. Typically, this would be used to share a
document on another machine.
This method allows sharing an InputStream containing the document’s data. Typically, this would
be used to share a document on the local machine.
In each method, the application must supply the content type of the document. This is typically
application/pdf in the case of PDFs, or something like image/jpeg in the case of images (or
similar, for example image/png).
onOpened(AssistSharedDocument)
onError(AssistSharedDocument)
Called when an error overlay is displayed by CBA Live Assist due to the failure to successfully
display the shared document for some reason.
onDocumentClosed(AssistSharedDocumentClosedEvent)
If the application calls either of these methods while the consumer is not in a co-browse session,
they throw an AssistNotInCobrowseException. You cannot share a document with an agent if you
are not actually co-browsing.
If the application provides an invalid content type (that is, it is not a PDF or image), both methods
throw an AssistInvalidContentTypeException.
Note: This is simply a check on the contentType argument provided to the API; if the call
provides a valid content type but invalid data (for example, trying to load a .DOCX file, but
specifying the content type as a PDF) then the methods do not throw this exception; instead,
CBA Live Assist displays an error overlay and fires the onError method.
The major distinction between errors that are presented by throwing an Exception or the onError
callback on the listener, is that the Exceptions handle anything that can be synchronously
verified as incorrect (such as not being in a co-browse); onError is for errors that occur during the
asynchronous loading of the document (for example, if the call provides a valid argument, such
as a well-formed URL, but the URL returns a 404 Not found error message, then CBA Live
Assist can not report that synchronously).
Example:
try
{
AssistDocumentShareManager sm = Assist.getDocumentShareManager();
FileInputStream fis = new FileInputStream("document.pdf");
sm.shareDocument(fis, "application/pdf", new DocListener());
}
catch (AssistNotInCobrowseException e)
{
Toast.makeText(this,
"Error: can't share document when not in cobrowse",
Toast.LENGTH_SHORT).show();
}
catch (AssistInvalidContentTypeException e)
{
Toast.makeText(this,
"Error: document must be an image or pdf", Toast.LENGTH_SHORT).show();
}
To disable the close buttons in shared document views in the CBA Live Assist SDK, edit the
following files in the layout resource directory accompanying the SDK, to remove the View UI
component which has the assist_doc_close ID:
assist_closeable_document.xml
assist_closeable_popup.xml
assist_closeable_single_page_document.xml
assist_error_popup.xml
<com.alicecallsbob.assist.sdk.overlay.view.impl.AssistRelativeLayout
xmlns:android=”http://schemas.android.com/apk/res/android"
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:background=”@color/document_popup_background”>
<FrameLayout
android:id=”@+id/assist_popup_content”
android:layout_width=”match_parent”
android:layout_height=”match_parent”/>
<!–
<Button
android:id=”@+id/assist_doc_close”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”@string/close_popup_text”
android:textColor=”#FFFFFF”
android:layout_alignTop=”@id/assist_popup_content”
android:layout_alignRight=”@id/assist_popup_content”/>
-->
</com.alicecallsbob.assist.sdk.overlay.view.impl.AssistRelativeLayout>
By default, the CBA Live Assist SDK displays any annotations which the application receives
on an overlay, so that the consumer can see them together with their own screen. Normally an
application needs to do nothing further, but if it needs to receive notifications when an annotation
arrives, it can implement the AssistAnnotationListener interface, and supply the implementation
in the AssistConfig object (see the The AssistConfigBuilder section).
An AnnotationContext for each support session, which can be used to manually clear
annotations, or to turn automatic clearing on or off.
@Override
public void newAnnotation(Annotation annotation, String sourceName)
{
}
Path getPath()
This is the standard Android library Path object that is used to draw the new Annotation
int getStrokeColour()
int getStrokeWidth()
float getStrokeOpacity()
The sourceName is the name of the source that created the annotation, for example the agent’s
name.
@Override
public void annotationsCleared()
{
This method is called every time the annotations are cleared on the screen, regardless of how it
is triggered. For example, the method is called if the agent clears annotations, or if the
application calls the AnnotationContext.clearAnnotations method (see the Annotation Context
section).
Annotation Context
The application can turn automatic clearing of annotations off or on by calling the
setClearAnnotationsOnScreenChange method, passing false to turn them off and true to turn
them on. Automatic clearing can be set at any time during the support session. Typically,
applications set it to false to enable other views to draw over the support screen without clearing
the annotations:
@Override
public void annotationContextInitialised(AnnotationContext annotationContext)
{
// turn off automatic annotation clearing
annotationContext.setClearAnnotationsOnScreenChange(false);
// store AnnotationContext to be able to clear annotations later
this.annotationContext = annotationContext;
}
@Override
You can obtain the Path using getPath; you can then get the end point and tangent of the
annotation from the Path object. You can use the end point and tangent to place a label at
the end of the line and facing in the direction of the annotation.
Use the standard Android library class PathMeasure to obtain the end point and tangent of
the annotation Path:
The call to getPosTan causes the endPoint[] and tangent[] to be populated with the end point X
and Y co-ordinates and tangent of the Path at the end of the annotation:
@Override
public void annotationContextInitialised(AnnotationContext annotationContext)
{
annotationContext.setClearAnnotationsOnScreenChange(false);
}
@Override
public void annotationContextEnded(AnnotationContext annotationContext)
{
}
@Override
public void annotationsCleared()
{
}
@Override
public void newAnnotation(Annotation annotation, String sourceName)
{
Path path = annotation.getPath();
PathMeasure pm = new PathMeasure(path, false);
float length = pm.getLength();
float[] endPoint = new float[2];
float[] tangent = new float[2];
pm.getPosTan(length, endPoint, tangent);
The annotationBitmap now has the annotation and the agent’s name, and is available for use
outside the listener (if a getter is provided). The strokeColour, strokeWidth, and strokeOpacity
found on the Annotation object are used to keep the label consistent with the annotation.
Form Filling
One of the main reasons for a consumer to ask for help, or for an agent to request a co-browse,
is to enable the agent to help the consumer to complete a form which is displayed on their
device. The agent can do this whenever a CBA Live Assist co-browse session is active, without
further intervention from the application, but there are some constraints on how forms should be
designed.
The CBA Live Assist SDK automatically detects form fields represented by EditText,
RadioButton, CheckBox, or Spinner View types, and relays these forms to the agent so that the
agent can fill in values for the user. You must provide these form fields with unique labels in the
layout.xml, in one of the following ways:
setting the android:contentDescription attribute inside the xml element which defines the
field itself:
<EditText
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:inputType=”number”
android:ems=”10”
android:contentDescription=”Other Loans”
/>
providing a label for the field and including the android:labelFor attribute inside the label’s
xml element:
<TextView
android:layout_height=”wrap_content”
android:text=”Other Loans: “
android:layout_gravity=”center_vertical”
android:labelFor=”@+id/field”
/>
For View instances where the inputType attribute may be specified, the SDK automatically
prevents the agent from performing form fill on any password-related inputType. These include
textPassword, textWebPassword, textVisiblePassword, and numberPassword inputTypes. In
order to successfully exclude these fields, CBA Live Assist SDK expects them to be the only
inputType present on the given View.
Note: While the SDK prevents these fields from being presented to the agent as fillable form
data, it does not prevent them from being visible as part of the co-browse. You can hide them by
adding the appropriate tag or permission to the View (see the Excluding elements from a view
section).
If you use a custom Adapter to provide the data for a Spinner, you must implement the
Adapter.getItem(position) method to return some object. The Spinner does not display in the
agent’s form editor if getItem(position) simply returns null.
Most applications implement getItem(position) to return a String; if it returns an object other than
a string, you should override that object’s toString method to return the string value that you want
to be displayed on the device. This ensures that the agent sees the correct values for the spinner
in the form editor; if you do not override toString, the agent will see the object ID for each spinner
item, rather than the value that is displayed on the device.
When an agent is co-browsing a form, you may not want the agent to see every control on the
form. Some may be irrelevant, and some may be private to the consumer.
You can hide an element by assigning a special tag to it. To exclude an area of the screen from
the screenshare, add this tag to the View object representing the area:
For more detailed control over element visibility, see the Permissions section.
Note: If you are using a WebView, and using HTML elements on that WebView, you cannot
exclude individual HTML elements from being seen by the agent. You can exclude the whole
WebView using the above techniques, but the methods described in the CBA Live Assist Web
Developer Guide for masking individual elements do not work. See the Permissions in Web
Views section for a technique which does.
The SDK provides a means to customize the visual indication displayed during screen sharing.
The default implementation displays a notification icon in the notification bar during the
application screenshare, and a toast when the sharing begins and ends. To use your own icon,
place it in the res/drawable folder, and name it launcher_icon.png.
If you want to change this behavior, and not simply use your own icon, provide an
implementation of the AssistCobrowseListener to the AssistConfigBuilder:
When a co-browse session disconnects due to technical issues, the default behavior is to
attempt to reconnect six times at increasing intervals. You can control this behavior by passing in
Connection configuration
Connection Configuration
You can set the connection configuration by specifying a ConnectionProfile in the AssistConfig
object which you pass in when the application calls startSupport. You can use a builder for the
ConnectionProfile, just as you can for the AssistConfig itself:
setInitialConnectionTimeout(30.0).
setConnectionProfile(profile).build();
Assist.startSupport(config, …);
The above example sets a timeout for the initial connection of 30 seconds; if the connection is
lost, it will try to reconnect 3 times, at intervals of 5, 10, and 15 seconds. The first reconnection
attempt will time out after 0.1 seconds, the second after 1 second, and the third after 10
seconds.
The ConnectionProfile settings have default values, so there is no need to specify all (or any) of
them. Default values and behavior is as follows:
Note: Reconnection applies only to the case where CBA Live Assist loses an existing
connection; if the initial connection attempt fails, CBA Live Assist does not retry automatically.
If the default reconnection behavior of CBA Live Assist is not what you want, even after
changing the configuration, you can implement the ConnectionStatusListener interface to
implement your own reconnection logic, and include it in the AssistConfig object which you pass
to startSupport - see the Starting a Support Session section and the ConnectionStatusListener
section for details. Note:
If you do not specify a ConnectionProfile in the AssistConfig, CBA Live Assist will use its
default reconnection behavior.
You can turn off the default reconnection behavior, and take full control of reconnection, by
specifying an empty list for retryIntervals.
Method Description
Called for the initial WebSocket failure, and for every failed reconnection
attempt (including the last one).
This may be useful to clear an error indication in the application UI, or for
onConnect
canceling reconnection attempts if the application is managing its own
reconnections.
In this example, the default reconnection behavior has been disabled, and the application
reconnection behavior is dependent on the reason for disconnection.
In this example, the default reconnection behavior has not been disabled, but there is a UI
control which the user can press to short-circuit the reconnection attempts. If the user has not
terminated the connection attempts, automatic reconnection attempts continue.
For any HTTP or HTTPS connections originating from WebView objects controlled by CBA
Live Assist, the SDK uses any cookies set using the global WebView CookieManager. You
can access the global CookieManager using:
android.webkit.CookieManager.getInstance();
For HTTP or HTTPS connections originating from the SDK outside a WebView, the SDK
uses cookies set using the default system java.net.CookieHandler object. You can access
this using:
java.net.CookieHandler.getDefault();
java.net.CookieHandler.setDefault(bespokeCookieHandler);
Note: CBA Live Assist does not supply a default CookieHandler - this is the responsibility of the
application.
Assist.setPermissionForView(“X”, control);
Each UI element has at most one permission marker value; elements which do not have a
permission marker inherit their parent element’s permission marker; an element which does not
have a permission marker either assigned explicitly or inherited from its parent, is assigned the
default permission marker.
Agent permissions
Agents have two sets of permissions, viewable permissions and interactive permissions.
Each set may contain an arbitrary number of values. Agents which are not assigned any
permissions have the default permission for both interactive and viewable permission sets.
CBA Live Assist grants permissions to the agent when the agent presents a Session Token
Description to the CBA Live Assist server (see the CBA Live Assist Agent Console
Developer Guide for more information about setting agent permissions, and under what
circumstances the agent can be implicitly assigned the default permission).
The application can determine an agent’s permissions from the Agent object which it receives in
the methods of the AssistAgentCobrowseListener interface (see the
AssistAgentCobrowseListener section). If the application needs to examine this (for instance, to
notify the consumer that a particular control will not be visible to the agent), use the
Agent.getViewablePermissions and Agent.getInteractivePermissions methods.
The combination of the element’s and the agent’s permissions determines the visibility of a UI
element to an agent. A UI element is visible to a specific agent if, and only if, the agent’s set of
viewable permissions contains the permission marker assigned to or inherited by that element.
Similarly, an agent may interact with a UI element if and only if the agent’s set of interactive
permissions contains the element’s permission marker.
Permissions and permission markers are free-form text, which (apart from the reserved default
permission) are in the control of the application developer. CBA Live Assist will show to the
agent those, and only those, elements which the agent has permission to view; but it is up to the
application developer to ensure that each agent has the permissions they need, and that the UI
elements have corresponding permission markers assigned.
CBA Live Assist assumption: When an agent wishes to establish a co-browse, the permissions
the agent should have, as defined by the organization’s infrastructure, are known, and can be
translated into an equivalent set of permissions in the Session Description.
Agent Agent
Permission
viewable interactive
marker on Result
permission permission
element
set set
Note: In some circumstances an agent can be granted the default permission implicitly, but that
is not the same thing as having an empty set of permissions. In the above table, an empty
set of agent permissions means exactly that; a set of permissions containing only the default
permission may have been granted either implicitly or explicitly.
A child element can override its parent permission marker, but it will only be effective if the
agent’s viewable permission set contains the parent’s permission marker as well as the child’s
(the agent must be able to see the container in order to interact with an element inside it). This
allows the developer to make a child element interactive and the parent element not. An example
use of this could be a child button within a parent container, where only the button needs to be
interactive.
Default Permission
You do not have to assign a permission marker to every UI element which you want agents to
view or interact with; every element which does not have or inherit a permission automatically
has the default permission marker.
Elements which have the default permission marker are viewable and interactive for any agent
which has the default permission. Any agent which has the default permission includes the
reserved word default among its set of permissions (as returned by
Agent.getViewablePermissions or Agent.getInteractivePermissions).
Not every agent has the default permission, and an agent might have the default permission in
its viewable permissions, but not in its interactive permissions.
The application can add permissions to HTML elements on a web page loaded with WebView. To
do this, call:
where X is the permission marker to be set, ELEMENTID is the ID of the web page element,
and application is the Android Application object. This method provides similar functionality for
web pages loaded in WebView as is provided for native Android controls.
The application can remove all the permissions from all the elements on an HTML page by
calling:
Assist.resetAllWebPermissions(application);
Note: The application cannot set permissions on elements within an iframe in an HTML page
loaded into a WebView; nor will elements in an iframe which have the assist-no-show class (see
the CBA Live Assist Web Developer Guide) be masked.
void init()
{
String sessionToken = getSessionToken();
UC uc = UCFactory.createUc(context, sessionToken, this);
uc.startSession();
}
After the call is connected, you need to escalate that call to co-browse (see the Escalating an
existing call to include co-browse section). In order to control the call while it is in progress, the
application saves the Call object returned by phone.createCall, so that it can use it when
needed. For convenience of illustration, the code above implements the CallListener and
UCListener interfaces which receive information on the progress of session creation and call
setup.
setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);
fusionclient-android-sdk2.x.x.jar file
andarmeabi-v7a
To create a CBA Live Assist session without voice and video, provide a correlation ID (using
setCorrelationId), but without specifying an agent name (using setAgentName(..)) when
configuring the AssistConfigBuilder.
The application can then call Assist.startSupport as described in the Starting a Support Session
section. You do not need to call setMediaMode on the AssistConfigBuilder when carrying out a
CBA Live Assist-only session. It will be necessary to explicitly call AssistSDK.endSupport to
end the session. Note:
The correlation ID needs to be known to both parties in the call, and needs to be unique
enough that the same correlation ID is not used by two support calls at the same time. The
application developer must decide the mechanism by which this happens, but possible ways
are for both parties to calculate a value from data about the call known to both of them, or
for one side to generate it and communicate it to the other on the existing communication
channel. There is also a REST service provided by CBA Live Assist which will create a
correlation ID and associate it with a short code; see the Informing the Agent of the
Correlation ID section.
The CBA Live Assist SDK throws an Exception if the application tries to make a voice and
video call without the fusionclient-android-sdk2.x.x.jar and armeabi-v7a libraries present,
and will show the following message in the logs:
RuntimeException—CSDK library not found, cannot create call. Please check the classpath
and/or refer to the documentation for more information.
To remedy this, either add the libraries to the application, or create a CBA Live Assist session
without voice and video.
CBA Live Assist gives some help to the application in informing the agent of the correlation ID;
it can create a short code and associate it with the correlation ID when it creates the session,
and the client can send the short code out-of-band to the agent:
The advantage of communicating a short code, rather than communicating the correlation ID
directly, is that the short code generated by the CBA Live Assist server is guaranteed to be both
unique during the communication process, and short enough for the client to communicate by
voice (or whatever other out-of-band communication channel is in use) without error. Note:
The short code expires 5 minutes after creation; it should therefore be used as soon as
possible after being created.
Once a short code has been used by both agent and consumer to communicate a
correlation ID, it is discarded, and may be used by a different agent and consumer to
communicate a different correlation ID.
There is a second scenario in which the short code REST service can be used when there is no
existing call between the two parties. If an agent is in a co-browse session with a consumer and
wishes to include a second agent in the same co-browse session, the agent already knows the
The second agent application uses the short code in exactly the same way as before to connect
to the same co-browse session as the first agent and the consumer.
If you wish to integrate your CBA Live Assist application with an existing authentication and
authorization system, you can disable the built-in mechanism (by setting the Anonymous
Consumer Access setting to disabled using the Web Administration service; see the CBA Live
Assist Overview and Installation Guide for how to do this), and replace it with a bespoke
implementation which uses the existing system to authorize and authenticate the client.
Once you have authenticated and authorized the application using the pre-existing system, the
application needs to create a session token (see the Fusion Client SDK documentation for
details of how to create the session token) and associate it with a correlation ID.
1. Create a Web Application that can invoke the Session Token API REST Service, exposed
by the FCSDK Web Gateway.
2. Provide the appropriate Fusion Client SDK (if in use) configuration in a JSON object (the
session description).
AED2.metadata.role
AED2.metadata.auditName
AED2.allowedTopic
A regular expression which limits the correlation IDs which the session token can be used to
connect to. A value of .* allows the session token to be used to connect to any support session
with any correlation ID. For security reasons, we recommend that this should be set to the value
of the correlation ID which will actually be used:
{
...
"voice": {
...
},
"aed": {
"accessibleSessionIdRegex": "customer-ABCDE",
...
},
...
"additionalAttributes": {
"AED2.allowedTopic": "%s",
"AED2.metadata": {
"role": "agent",
"name": "Example Agent",
"permissions":
{ "viewable": \["test", "default"\], "interactive": \["go", "text", "default"\]
}
}
}
...
}
4. Request a session token by sending an HTTP POST request to the Session Token API,
providing the session description in the body of the POST.
For steps 1, 2, and 4, see the FCSDK Developer Guide, Creating the Web Application.
Note: The FCSDK Developer Guide documents both voice and aed sections - at least one of
these must be present to create the session token. However, if the session description includes a
voice section (which it must if voice and video functionality is required), then only the AED2
entries are needed for CBA Live Assist functionality. If voice and video functionality is not
Alert boxes
Keyboard
Menus generated by HTML (for example, the popup menu generated by the HTML <select>
element).
You should consider whether the agent needs to see those elements, and consider alternative
implementations on the consumer side, such as JavaScript and CSS.
Before loading the WebView, you can set the layer type for the WebView to software:
WebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
Guidance for hardware and software rendering can be found in the Android documentation.