0% found this document useful (0 votes)
36 views

LA iOS Developer Guide

Uploaded by

Ferdinand Louis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

LA iOS Developer Guide

Uploaded by

Ferdinand Louis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

LA iOS Developer Guide

YRP1-508, 3-4 Hikari-no-Oka Yokosuka-Shi, Kanagawa, 239-0847, Japan


tel.: + 81-(0) 46-821-3362 | cba-japan.com
This document contains confidential information that is proprietary to CBA. No part of its contents
may be used, disclosed or conveyed to any party, in any manner whatsoever, without prior
written permission from CBA.
© Copyright 2023 CBA.

All rights reserved.

Updated: 2022-06-23

Document version: 1.64.15

Contact Information

For technical support or other queries, contact CBA Support at:

[email protected]

For our worldwide corporate office address, see:

https://www.cba-japan.com (Japanese) https://www.cba-gbl.com (English)

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 2


#Contents

Introduction
Integration with an Existing Application
Embedding the Fusion Client SDK Library
Embedding the CBA Live Assist Library
Header Files
Using CBA Live Assist as a Swift Package
The use of Swift Package starting in version 1.64.8
Using LASDK Swift Package in a Framework or Static Library
Creating an XCFramework
Note
Starting a Support Session
Session Configuration
Escalating a Call to Include Co-browse
Ending a Session
During a Co-browse Session
Application Delegation
AssistSDKDelegate
AssistSDKAnnotationDelegate
AssistSDKDocumentDelegate
ASDKAgentCobrowseDelegate
ASDKScreenShareRequestedDelegate
ASDKPushAuthorizationDelegate
ASDKConnectionStatusDelegate
Allow and Disallow Co-browse for an Agent
Agent accepted into co-browse
Agent rejected from co-browse
Pausing and Resuming a Co-browsing Session
Sharing Documents
Embedding Shared Documents
Setting Shared Document View Constraints
Pre-Processor Macros
Annotations
Notification of Annotations Received

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 3


Notification of Annotations Cleared
Form Filling
Excluding Elements from Co-browsing
Snapshots
WebSocket Reconnection Control
Connection Configuration
Connection Status Delegate
Cookies
Permissions
Agent and Element Permissions
Parent and Child Permissions
Default Permission
Permissions in Web Views
Internationalization
Integrating with FCSDK
Using CBA Live Assist without Voice and Video
Informing the Agent of the Correlation ID
Including a Second Agent
Consumer Session Creation
Session Token Creation
Error Codes
Alerts and System Dialog Boxes
Accepting Self-Signed Certificates
Password Fields
IPv6 Support

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 4


Introduction
This guide describes the Fusion Live Assist solution from a developer integration and impact
point of view. We assume that the reader is familiar with iOS, XCode, and Objective-C.

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 iOS
application, and how to use it to provide the co-browsing functions to a consumer.

References:

[1] FCSDK Developer Guide, obtained from CBA product documentation

[2] FCSDK Administration Guide, obtained from CBA product documentation

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 5


Integration with an Existing Application
You can integrate CBA Live Assist with an existing iOS application. You need to create an
Xcode project. For simplicity, the examples following assume that the project was empty, but a
similar approach will work if you want to add the CBA Live Assist SDK to an existing iOS
application.

Embedding the Fusion Client SDK Library

CBA Live Assist relies on the voice and video capabilities of FCSDK - unless the application
only uses the co-browse mode of CBA Live Assist, you must install the Fusion Client SDK
library (see the FCSDK Developer Guide for details of how to install the Fusion Client SDK
into the Xcode project).

By default, CBA Live Assist requests its own sessions from Fusion Client SDK when the
application starts a support session (see the Starting a Support Session section). You do not
need to start a session explicitly, unless you need to integrate the CBA Live Assist application
with an existing authentication and authorization mechanism (see the Consumer Session
Creation section).

Embedding the CBA Live Assist Library

You need to link your code with the CBA Live Assist libraries and header files supplied in the
cba_live_assist_iOS_SDK-x.x.x.zip file, inside the assist_ios_sdk folder:

1. Copy the contents of the assist_ios_sdk folder of the cba_live_assist_iOS_SDK-x.x.x.zip file


somewhere suitable. This contains the headers and libraries for the application to link with.

2. In the Target>Build Phases>LinkBinary With Libraries section of your Xcode project, add
the libAssistSDK.a file.

3. In the Target>Build Phases>LinkBinary With Libraries section of your Xcode project, add
the following standard libraries:

ImageIO.framework

MobileCoreServices.framework

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 6


WebKit.framework

4. In Build Settings, ensure that Header Search Paths includes the location of AssistSDK.h,
and that Library Search Paths includes the location of the libAssistSDK.a file.

Your project should look something like:

Header Files

The public CBA Live Assist functions are defined in the CBA Live Assist header file,
AssistSDK.h. You must include this in any compilation unit which makes use of the CBA Live
Assist SDK:

@import AssistSDK;

Using CBA Live Assist as a Swift Package

Bitcode can be enabled in the Build Settings

Enable Bitcode = YES

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 7


The use of Swift Package starting in version 1.64.8

We can fetch AssistSDK from GitHub and use it in our project by doing the following:

1. In your Xcode Project, select File > Swift Packages > Add Package
Dependency.
2. Follow the prompts using this url for LASDK-
https://github.com/cbajapan/fusion-live-assist-sdk.git
3. Choose which version you would like to checkout

Or you can clone the Package and use it locally using git clone . This is more work and not
recommended

To set up a project using the Swift Package we want to depend on the Swift Package at the root
level of your project.

1. Open your Xcode project and drag the unzipped Swift Package into the root level of your
project, typically you can do this directly under the project as shown in the image below

2. We want to make sure that the Swift Package has the little arrow next to the package in the
directory window. If yours does not look like this, close the Xcode project and re-open it.
This is a known Xcode bug.

3. Click the General tab of your Target, and expand the Frameworks, Libraries, and Embedded
Content section by clicking on the title.

4. Click the + button; the file explorer displays.

5. Select the AssistSDK Library and press add

image_8.png

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 8


5. Done, your project is now ready to use Fusion Client SDK

Using LASDK Swift Package in a Framework or Static


Library

If you are interested in building a Static Library instead of a Framework the process is the
same

LASDK Swift Package contains 1 dependency and 1 binary target

1. Binary Target- AssistSDK


2. Dependency- FCSDK-iOS

FCSDK-iOS consists of 2 Frameworks

1. ACBClientSDK
2. CBARealTime

The nature of Frameworks and Static Libraries cause us to use them in a very specific way.
Apple will not allow Embedded Frameworks to be released on the App Store in iOS. So that
means if you try and embed these 2 frameworks into your framework, it will inevitably fail. What
you want to do when it comes to depending on a framework within your framework is to link the
child framework to the parent framework, but DO NOT EMBED THEM. This will result in the
External Symbols being linked, but not the internal symbols. So, if you try to place the framework
you created in your application, you will get several errors saying that there are symbols missing.
How can this be resolved? You need to import those same 2 frameworks you depend on in your
framework into the Application you are building.

This seems like a lot of work, so we have done most of it for you with our Swift Package.

All you need to do is import the Swift Package into your framework as described above.
However, in order to use the Framework you are developing in an iOS application there are a
couple of steps you will need to follow.

We basically have 2 options:

1. Do as described above and import your framework that depends on AssistSDK along with
AssistSDK into the iOS application. OR
2. Let Swift Package Manager handle all of that for you.

We will describe option 2, as it is our recommendation.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 9


You will want to create a Swift Package in order to distribute your XCFramework.

1. Open Terminal
2. Create a directory - you can name it something like my-framework-kit with mkdir
MY_DIRECTORY

3. Move into that directory with cd my-framework-kit


4. Create the Swift Package with swift package init
5. Open Package.swift in Xcode
6. Make sure that your XCFramework is in the root directory of the Swift Package, so in our
case, it should be located in my-framework-kit

Now, with Package.swift open make sure it looks like this

// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to
build this package.

import PackageDescription

let package = Package(


name: "my-framework-kit",
products: [
.library(
name: "my-framework-kit",
type: .static,
targets: ["my-framework-kit"]),
],
dependencies: [
.package(name: "ACBClientSDK", url: "https://github.com/cbajapan/acb-
client-sdk.git", .exact("3.x.x-rc.1.1"))
],
targets: [
.target(
name: "my-framework-kit",
dependencies: [
"my-framework",
.product(name: "ACBClientSDK", package: "ACBClientSDK")
]),
.binaryTarget(name: "my-framework", path: "my-framework.xcframework")
]
)

I will describe what this file does - What we are mostly interested in is the Package

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 10


Inside this initializer, we have 4 properties:

1. Name
2. Products
3. Dependencies
4. Target

Name is not very important, but typically this is the name of the directory you made
Products consists of the Libraries name; we also need to specify this Library as a Static
Library, and we want to tell it about our Target that we define in Packages final property.
Dependencies are any code that you want to bring in from a url that is an internal or external
resource, so basically, other Swift Packages. Here we are depending on FCSDK-iOS
Finally, our Targets involves the target we want our package to know about and its
dependencies. So here we are depending on our my-framework.xcframework binary
locally, and then we need to tell the target about the package dependency we fetch from
Github. We also need to tell our target where our XCFramework is located in the
binaryTarget

Once we create our Swift Package, as describe above, we have 2 options:

1. Depend on it Locally as Described in - The use of Swift Package starting in version


3.3.21
2. Commit our Swift Package to a git repo and have our iOS client fetch it from there. We can
fetch remote code from our iOS Project by doing the following: ```
3. In your Xcode Project, select File > Swift Packages > Add Package Dependency.
4. Follow the prompts using the URL for this repository
5. Choose which version you would like to checkout (i.e. 3.3.21)

## Creating an XCFramework

In order to create an XCFramework that supports a variety of Architectures we recommend using


a shell script to Archive your project’s target and then create the XCFramework. So in the root of
your Framework or Static Library Create a file and call it something like build.sh

Here is an example of what build.sh need to have inside of it

Note

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 11


You need to make sure that in your project in the Xcode Build Settings these 2 settings are set
accordingly SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES

#!/bin/zsh

xcodebuild archive \
-project YourProject.xcodeproj \
-scheme YourProjectTarget \
-archivePath target/xcodebuild/device.xcarchive \
-destination "generic/platform=iOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
ARCHS="arm64" \
IPHONEOS_DEPLOYMENT_TARGET=12.0 \
# If you want to enable bitcode these are the lines you need
ENABLE_BITCODE=YES \
OTHER_CFLAGS="-fembed-bitcode" \
OTHER_CPLUSPLUSFLAGS="-fembed-bitcode"

# Simulator builds don't have bitcode abilities


xcodebuild archive \
-project YourProject.xcodeproj \
-scheme YourProject \
-archivePath build/simulator.xcarchive \
-destination "generic/platform=iOS Simulator" \
SKIP_INSTALL=NO \
ARCHS="x86_64 arm64" \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
IPHONEOS_DEPLOYMENT_TARGET=12.0

#Time to create an XCFramework with device and simulator for a Static Library
xcodebuild -create-xcframework \
-library build/device.xcarchive/Products/usr/local/lib/libYourFramework.a \
-headers build/device.xcarchive/Products/usr/local/include \
-library build/simulator.xcarchive/Products/usr/local/lib/libYourFramework.a \
-headers build/simulator.xcarchive/Products/usr/local/include \
-output build/YourFramework.xcframework

If you want to create an XCFramework from a Framework instead replace the above code with
something like this

xcodebuild -create-xcframework \
-framework

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 12


build/device.xcarchive/Products/Library/Frameworks/YourFramework.framework \
-framework
build/simulator.xcarchive/Products/Library/Frameworks/YourFramework.framework \
-output build/YourFramework.xcframework

Then you can just run the shell script in it’s directory sh build.sh You should have an
XCFramework inside of the build folder indicated in -output

Starting a Support Session

The application starts a support session, normally in response to the user clicking on a Help or
Request Support button, by making a call to the AssistSDKstartSupport class method:

[AssistSDK startSupport:@"support.test.com" destination:@"agent1"];

The first argument (server) is an NSString. It can be the fully qualified hostname or IP
address of the CBA Live Assist server (as above), or it can be a URL.

[AssistSDK startSupport:@"https://support.test.com:8443"
destination:@"agent1"];

Note: If it is a URL, it should include only a scheme, hostname, and port. If the application is
behind a reverse proxy, use a URL instead of just the server name.

The second argument (destination) is also an NSString, and is the name of the agent or
queue to contact.

@import AssistSDK;

@interface WelcomeController ()
@end

@implementation WelcomeController

- (IBAction) startLiveAssist:(id)sender {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *address = [defaults stringForKey: @"serverAddress"];
if ((address == nil) || ([address length] == 0)) {
address = @"server.test.com";
}

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 13


// the single line to start the CBA Live Assist SDK
[AssistSDK startSupport: address destination:@"agent1"];
}

@end

Session Configuration
There is a more complex form of the startSupport method, which takes an NSDictionary as its
second parameter. This parameter (supportParameters) can have a number of properties set on
it to configure the session:

Default Value
Property Description
or Behavior

User name of agent or agent group


(NSString), if that agent or agent group is
destination
local to the Web Gateway; otherwise, the full
SIP URI of an agent or queue.

Sets whether to show video (NSString), and


from which parties. Allowed values are:
videoMode @“full” •full
•agentOnly
•none

correlationId ID of the co-browsing session (NSString)

Name to identify the consumer in event logs


(see the CBA Live Assist Overview and
auditName empty string
Installation Guide for more details on event
logging). This value should be URL encoded.

@YES or @NO (NSNumber). Set to @YES


to asccept self-signed certificates in
acceptSelfSignedCerts @NO
development environments. See the
Accepting Self-Signed Certificates section.

useCookies @NO @YES or @NO (NSNumber). Set to @YES


to send cookies set up to be sent to the CBA

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 14


Live Assist server on to the WebSocket
connection.

@YES or @NO (NSNumber). Set to @YES


isAgentWindowOnTop @NO
to force the agent window to be topmost.

Set of numeric tags to use for obscuring


content with black rectangles on the agent
hidingTags
console (NSSet). See the Excluding Elements
from Co-browsing section.

Set of numeric tags to use for masking


content, making it appear as black or colored
maskingTags boxes on the agent console (NSSet). See the
Excluding Elements from Co-browsing
section.

Color of boxes to be shown on agent console


maskColor
in place of masked content (UIColor).

Time in seconds to wait to establish


timeout communication with the CBA Live Assist
server (NSNumber).

FCSDK Web Gateway session token (if


sessionToken required) (NSString). See the Escalating a
Call to Include Co-browse section.

Instance of a class conforming to


documentView ASDKDocumentViewConstraints. See the
Constraints Setting Shared Document View Constraints
section.

@YES or @NO (NSNumber). Set to @NO to


addSharedDocClose remove any Close link from a shared
@YES
Listener document, so that the agent and consumer
cannot manually close the document.

@YES or @NO (NSNumber). Set to @YES


keepAnnotationsOn to keep annotations when the content behind
@NO
Change them changes. Set to @NO to clear them
when the content changes.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 15


Presents a
UIAlertView to Instance of a delegate which conforms to
prompt the ASDKScreenShareRequestedDelegate.
user to choose Specifying this allows an application to
screenShareRequested
whether to choose whether to accept or reject screen
Delegate
accept screen sharing however it sees fit. See the
sharing (but ASDKScreenShareRequestedDelegate
see the note section.
at the end)

Presents a
UIAlertView to
Instance of a delegate which conforms to
prompt the
ASDKAgentCobrowseDelegate. Specifying
user to choose
agentCobrowse this allows an application to receive
whether to
Delegate notifications of agents joining and leaving the
accept co-
session. See the
browsing (but
ASDKAgentCobrowseDelegate section.
see the note
at the end)

Instance of a delegate which conforms to


ASDKConnectionStatusDelegate. Specifying
connectionDelegate this allows an application to receive
notifications of connection events. See the
ASDKConnectionStatusDelegate section.

A delegate which conforms to the protocol


ASDKPushAuthorizationDelegate. Specifying
this allows an application to choose whether
pushDelegate
to accept or reject pushed content however it
sees fit. See the
ASDKPushAuthorizationDelegate section.

uui The value set is placed in the SIP User to


User header in hex-encoded form.
Note: The UUI can only be used when
Anonymous Consumer Access is set to
trusted mode. See the CBA Live Assist
Architecture Guide for further information. The

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 16


UUI is ignored if the session token is
provided.

Indicates the number of automatic


[@1.0f, @2.0f, reconnection attempts, and the time in
@4.0f, @8.0f, seconds between each attempt. See the
retryIntervals
@16.0f, Connection Configuration section.
@32.0f] If an empty array is specified, then no
reconnection attempt is made.

Indicates the maximum times in seconds,


until WebSocket reconnection attempts fail.
An array of values is given that corresponds
to the values in retryIntervals - as each value
in retryIntervals is used, the relevant value is
maxReconnect used from this array. See the Connection
[@5.0f]
Timeouts Configuration section.
Note: If the length of the retryIntervals is
greater than that of
maxReconnectionTimeouts, then the last
value of the maxReconnectionTimeouts array
is used for the final attempts.

Indicates the maximum time in seconds until


initialConnectTimeout @30.0f the initial WebSocket connection attempt fails.
See the Connection Configuration section.

You need to configure the session in this way for the more advanced uses of CBA Live Assist
(see the During a Co-browse Session section), but the simple case is also covered:

NSDictionary *config = [NSDictionary dictionaryWithObjectsAndKeys:


@"agent1", @"destination", nil];
[AssistSDK startSupport: @"server.test.com"
supportParameters: config];

Note: The application will not receive calls to assistSDKScreenShareRequested in


ASDKScreenShareRequestedDelegate if it supplies an implementation of
ASDKAgentCobrowseDelegate, even if it also supplies an implementation of
assistSDKScreenShareRequested. In this case, only the methods in

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 17


ASDKAgentCobrowseDelegate are called. CBA Live Assist only displays the default UI if the
application supplies neither screenShareRequestedDelegate nor agentCobrowseDelegate.

Escalating a Call to Include Co-browse

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 configuration object 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.

1. The application connects to a specific URL on the CBA Live Assist server, to request a
short code (error handling omitted):

NSString *url = @"<fas address>/assistserver/shortcode/create"];


NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: url];
[request setHTTPMethod: @"PUT"];

NSURLSessionConfiguration *sc= [NSURLSession


sessionWithConfiguration:defaultConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:sc delegate:nil
delegateQueue:nil];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request
completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable
response,
NSError * _Nullable error) {
NSError *jerror = nil;
NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data
options:0 error:&jerror];
NSString *shortcode = dictionary[@"shortCode"];
}];
[task resume];

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:

NSString url = @"<fas address>/assistserver/shortcode/consumer?appkey=";


url = [url stringByAppendingString: shortcode];

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 18


NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: url];
[request setHTTPMethod: @"GET"];

NSURLSessionConfiguration *sc= [NSURLSession


sessionWithConfiguration:defaultConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:sc delegate:nil
delegateQueue:nil];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request
completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable
response,
NSError * _Nullable error) {
NSError *jerror = nil;
NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data
options:0 error:&jerror];
NSString *sessionToken = dictionary[@"session-token"];
NSString *correlationId = dictionary[@"cid"];
}];
[task resume];

3. The application includes those values in the configuration object, and passes it to
startSupport:

NSDictionary *configuration = [[NSMutableDictionary alloc] init];

configuration[@"sessionToken"] = sessionToken;
configuration[@"correlationId"] = correlationId;

[AssistSDK startSupport:@"<fas address>" supportParameters: configuration];

More configuration can be set in the configuration object.

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:

When escalating an existing call, the destination property should not be set on the
configuration object; in this case, the destination is known implicitly from the existing call.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 19


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

Ending a Session

When voice and video is enabled, the CBA Live Assist default UI allows the consumer to end
the session; otherwise, the session ends when the underlying support call ends. The application
can also end the session using the endSupport function.

If CBA Live Assist is in co-browse-only mode (see the Using CBA Live Assist without Voice and
Video section), the application must call endSupport explicitly, because CBA Live Assist does
not present its default UI to the user.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 20


During a Co-browse Session
While a co-browsing session is active (after the application has called startSupport successfully,
and before either it calls endSupport or receives the supportCallDidEnd notification (see the
AssistSDKDelegate section) to indicate that the agent has ended the support session), the
application may:

Accept an agent into, or expel the agent from, the co-browsing session

Pause and resume the co-browsing session

Receive a document from the agent

Push a document to the agent

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

Have a form on its screen wholly or partly filled in by the agent

Actions which are initiated by the application (such as pushing a document to the agent) require
it to call one of the class methods on the AssistSDK 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 providing an
implementation of one of the various Delegates, and can take control of the operations if it
wishes.

Application Delegation

An application can receive notification of certain actions that occur within CBA Live Assist and
take control of the response to them. The following sections discuss what notifications the
application can receive and what operations are available.

The application can add delegates conforming to the following protocols to the configuration
when it calls AssistSDKstartSupport:

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 21


ASDKScreenShareRequestedDelegate

ASDKAgentCobrowseDelegate

ASDKConnectionStatusDelegate

ASDKPushAuthorizationDelegate

It can only add a single instance of each of these delegates to the configuration (see the Session
Configuration section).

It can add delegates conforming to the following protocols using the AssistSDKaddDelegate
method:

AssistSDKDelegate

AssistSDKDocumentDelegate

AssistSDKAnnotationDelegate

AssistSDK supports multiple delegates for any of these protocols. Delegates registered with
AssistSDK must conform to at least one of them. If they do not, then they are not added to the
delegate set. The delegates are not ordered, and the order in which they receive messages is
not defined. Multiple delegates can support the same or different protocols. The application
manages the registered delegates by calling the addDelegate and removeDelegate class
methods.

In the following code, the TabViewController is the AssistSDKDelegate; it uses addDelegate to


register itself, and receives calls to two of its notifications:

@interface TabViewController : UITabBarController<AssistSDKDelegate>


@end

@implementation TabViewController {
}

- (void) start : (NSString*) server {


[AssistSDK addDelegate:self];
[AssistSDK startSupport:server destination:@"agent1"];
}

- (void) supportCallDidEnd{

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 22


- (void) assistSDKDidEncounterError:(NSNotification*) notification {
[self reportError:[notification object]];

- (void) reportError:(NSError*) error {

@end

Each NSNotification name is the capitalized form of the method name without the trailing colon;
for example @selector(assistSDKDidDoSomething) yields a name of
@“AssistSDKDidDoSomething”. NSNotification object and userInfo properties vary as detailed
below.

Note: The SDK defines another delegate protocol (AssistSDKConsumerDocumentDelegate),


which is passed to the document sharing methods (see the Sharing Documents section).

AssistSDKDelegate

Adopting AssistSDKDelegate and implementing its methods enables the application to receive
these notifications:

assistSDKDidEncounterError: (NSNotification*) notification

Implement this method to receive notifications when CBA Live Assist encounters an error. The
object of the notification parameter is an NSError. No keys are defined for the userInfo dictionary,
but error reporters may add additional details that could be useful.

Each reported NSError has its code attribute set to one of the constants provided in the supplied
ASDKErrorCodes.h file. See the Error Codes section.

cobrowseActiveDidChangeTo: (BOOL) active

Implement this method to receive notification when co-browsing becomes active or inactive. The
active parameter is YES if co-browsing has started, and NO if it has stopped. You could use this
to display something other than the default indication in the user interface.

supportCallDidEnd

Implement this method to receive notification of when the support call ends, either by the
application calling endSupport, or the agent hanging up the call.. The callback is triggered only

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 23


when an FCSDK support call is made; it does not occur in co-browse only mode. The callback
has no parameters.

Add this delegate using the AssistSDK addDelegate method.

Your application will probably want to adopt this delegate, at least for error reporting.

AssistSDKAnnotationDelegate
Adopt the AssistSDKAnnotationDelegate to receive notifications relating to annotations which the
agent may send to the consumer. It has three optional methods:

assistSDKWillAddAnnotation: (NSNotification*) notification

Called when the application receives an annotation from an agent. The application can make
changes to the annotation before CBA Live Assist displays it. See the Notification of
Annotations Received section.

assistSDKDidAddAnnotation: (NSNotification*) notification

Called when the application receives an annotation from an agent, immediately before CBA Live
Assist displays it. See the Notification of Annotations Received section.

assistSDKDidClearAnnotations: (NSNotification*) notification

Called when an agent clears the annotations. See the Notification of Annotations Cleared
section.

You can use this in order to control the display and clearing of annotations which the application
receives from the agent (see the Annotations section).

Add this delegate using the AssistSDK addDelegate method.

AssistSDKDocumentDelegate
Adopting AssistSDKDocumentDelegate enables an application to receive notification when the
agent sends a document to the consumer:

onOpened: (ASDKSharedDocument*) document

Called when the document has been received and displayed.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 24


onClosed: (ASDKSharedDocument*) document by: (AssistSDKDocumentCloseInitiator)
whom

Called when the document is closed. AssistSDKDocumentCloseInitiator is an enumeration with


the following members:

AssitSDKDocumentClosedByUnknown (sic.)

AssistSDKDocumentClosedByAgent

AssistSDKDocumentClosedByConsumer

AssistSDKDocumentClosedBySupportEnded

onError: (ASDKSharedDocument*) document reason: (NSString*) reasonStr

Called if there was a problem displaying the document or URI.

Each callback also has an ASDKSharedDocument parameter, which has a close method,
allowing the application to close the document programmatically. It also has an idNumber
property, allowing received documents to be compared, and a metadata property (an NSString),
which receives any additional information which the agent has associated with the document.

By default, the CBA Live Assist SDK displays the document. Acceptable document types are:
PDF, and the image formats GIF, PNG, and JPG/JPEG.

Note: If the agent pushes a URI, instead of a document, the SDK does not call either the
onOpened or onClosed methods; however, if there is a problem opening the URI, it will call
onError.

Add this delegate using the AssistSDK addDelegate method.

ASDKAgentCobrowseDelegate
Adopting the ASDKAgentCobrowseDelegate enables the application to receive the following
notifications:

agentJoinedSession: (ASDKAgent*) 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.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 25


agentRequestedCobrowse: (ASDKAgent*) 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: (ASDKAgent*) agent

This callback occurs when the agent joins the co-browse session.

agentLeftCobrowse: (ASDKAgent*) 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: (ASDKAgent*) 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. This
delegate also allows the application to store the agent value for later use (see the Allow and
Disallow Co-browse for an Agent section).

Add this delegate to the configuration when the application calls the AssistSDKstartSupport
method (see the Session Configuration section).

ASDKScreenShareRequestedDelegate
Adopting ASDKScreenShareRequestedDelegate allows the application to receive notifications
when the agent asks to share the consumer’s screen. It has a single method:

assistSDKScreenShareRequested: (void (^)(void)) allow deny: (void (^) (void)) deny

Called when the agent has requested to share the consumer’s screen. The allow and deny
parameters are functions which allow or reject the co-browse request. The application should call
one of them.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 26


By default, CBA Live Assist pops up a UIAlertView which presents the user with options to
accept or reject the request. The application can implement this method to override this
behavior:

-(void) assistSDKScreenShareRequested:
(void (^) (void)) allow deny: (void (^) (void)) deny {

if ([self allowScreenshare]) {
allow();
} else {
deny();
}
}

Pass an instance of a class which conforms to the ASDKScreenShareRequestedDelegate


protocol to startSupport as the screenShareRequestedDelegate attribute of the supportParams
(see the Session Configuration section).

ASDKPushAuthorizationDelegate
When the agent pushes a document (not a URI link) to the consumer, by default CBA Live
Assist prompts the consumer if they want to view it; if the consumer accepts, it shows the
document to the consumer.

An application can supply an ASDKPushAuthorizationDelegate in the supportParameters of the


call to startSupport (see the Session Configuration section) in order to control whether the
consumer sees the document (the consumer does not receive this when the agent pushes a
URI). It has a single callback (which is mandatory):

displaySharedDocumentRequested: (ASDKSharedDocument*) document, allow: (void (^)


(void)) allow deny: (void (^) (void)) deny

The document parameter is an ASDKSharedDocument (see the AssistSDKDocumentDelegate


section for details). The allow and deny parameters are functions which the application calls to
accept or reject sharing of the document:

- (void)displaySharedDocumentRequested:
(ASDKSharefDocument*)sharedDocument
allow:(void (^)(void))allow
deny:(void (^)(void))deny {

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 27


if ([self isSharingAuthorized]) {
allow();
} else {
deny();
}
}

In this case, sharing is allowed if the isSharingAuthorized method (not shown, but it could check
a flag set in the user interface or some application configuration, or show a bespoke prompt to
the user) returns true.

To always show the document without prompting:

- (void)displaySharedDocumentRequested:
(ASDKSharefDocument*)sharedDocument
allow:(void (^)(void))allow
deny:(void (^)(void))deny {
allow();
}

ASDKConnectionStatusDelegate

The ASDKConnectionStatusDelegate has the following methods, which supply notifications


about the connection status of the WebSocket connection to the CBA Live Assist server:

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: (NSError*)reason connector: (ASDKConnector*) connector)

Received when the WebSocket connection to the CBA Live Assist server has been lost, or has
failed to reconnect.

onTerminated: (NSError*) reason

Received when the WebSocket connection with the CBA Live Assist server has terminated, and
there will be no more reconnection attempts. If the termination is due to endSupport being called

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 28


explicitly, the error code will be ASDKAssistSupportEnded (see the Error Codes section).

willRetry: (float)inSeconds attempt: (int) attempt of: (int) maxAttempts connector:


(ASDKConnector*) connector)

Received when the CBA Live Assist SDK is preparing to retry a connection attempt (controlled
by the connection configuration which may be supplied in the configuration passed to
startSupport; see the Connection Configuration section).

These callbacks can be used to control the reconnection strategy (see the Connection Status
Delegate section).

Add this delegate to the configuration when the application calls the AssistSDK startSupport
method (see the Session Configuration section).

Allow and Disallow Co-browse for an Agent

You may wish to remove a specific agent from the co-browsing session. To do this, call:

[AssistSDK disallowCobrowseForAgent: agent];

passing in the ASDKAgent object received in one of the notifications on the


ASDKAgentCobrowseDelegate (see the ASDKAgentCobrowseDelegate section).

If the agent is already in the co-browse session, they are removed from it; if they are not in the
co-browse session, they will not be admitted until the application calls:

[AssistSDK allowCobrowseForAgent: agent];

When the application calls allowCobrowseForAgent, the specified agent joins the co-browse
immediately.

Agent accepted into co-browse

When an agent is accepted into the co-browse, the following occurs:

1. Consumer starts support session.

2. Agent joins session.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 29


3. agentJoinedSession callback fired in the consumer application.

4. Agent requests co-browse.

5. agentRequestedCobrowse callback fired in the consumer application.

6. The consumer application has logic that decides the agent is allowed access to the co-
browse. This logic could be based on permissions.

7. Agent is accepted into the co-browse.

8. Agent joins the co-browse.

9. agentJoinedCobrowse callback fired in the consumer application.

10. Agent can see the consumer’s screen.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 30


Agent rejected from co-browse

1. Agent requests co-browse.

2. agentRequestedCobrowse callback fired in the consumer application, with the agent’s


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.

Pausing and Resuming a Co-browsing Session

The application can temporarily pause a co-browse session with the agent by calling:

[AssistSDK 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:

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 31


[AssistSDK 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

As well as receiving shared documents from the agent (see the AssistSDKDocumentDelegate
section), applications can use the CBA Live Assist SDK to share documents with the agent
during a co-browsing session. Acceptable documents are PDFs and images.

Documents shared in this way are represented visually in the same way as documents that are
pushed from the agent: PDFs are full screen, and images are in windows that can be dragged,
re-sized, or moved.

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.

There are three class methods exposed by AssistSDK to handle document sharing:

(NSError*) shareDocumentUrl:(NSString*) documentUrl delegate:


(id<AssistSDKConsumerDocumentDelegate>) consumerShareDelegate

(NSError*) shareDocumentNSUrl:(NSURL*) documentUrl delegate:


(id<AssistSDKConsumerDocumentDelegate>) consumerShareDelegate

Both the above methods allow sharing a document given its URL. Typically, this would be used
to share a document on another machine.

Note: The close callback (onClose) is not called if a link is pushed by using either of these
methods.

(NSError*) shareDocument: (NSData*) content mimeType:(NSString*) mimeType delegate:


(id<AssistSDKConsumerDocumentDelegate>) consumerShareDelegate

This method allows sharing a data block containing the document’s data. Typically, this would be
used to share a document on the local machine. In this case you must supply the mime type
(typically @”application/pdf” for PDFs, or something like @”image/jpeg” or @”image/png” for
images).

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 32


Whichever method is used, the final parameter of the method is an optional instance of a class
conforming to AssistSDKConsumerDocumentDelegate which receives callbacks. The delegate
has two methods:

onError: (ASDKSharedDocument*) document reason: (NSString*) reasonStr

Called when an error overlay is displayed by CBA Live Assist due to the failure to successfully
display the shared document for some reason.

onClosed: (ASDKSharedDocument*) document by:(AssistDocumentCloseInitiator) whom

Called when the document is closed. See the AssistSDKDocumentDelegate section for the
whom parameter.

Note: For a consumer-shared document, the idNumber property of the ASDKSharedDocument


always has a value of -1.

Errors are handled in two ways:

By returning a non-nil NSError

By invoking the onError method of a specified AssistSDKConsumerDocumentDelegate


delegate.

The three methods return a non-nil NSError if they are invoked when screen-sharing is not
active. The delegate onError method is invoked for all other error cases, for example if:

An invalid URL is specified;

A document cannot be downloaded from the specified URL;

An invalid mime type is specified.

Embedding Shared Documents


By default, CBA Live Assist displays shared documents on top of the iOS application. The CBA
Live Assist iOS SDK allows an application to embed a shared document in its view hierarchy.
For example, an application may want to present a text chat window on top of a shared
document.

An application can embed shared documents as shown in the following steps:

1. Create an instance of the iOS SDK’s ASDKDefaultDocumentViewController class:

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 33


UIViewController *dvc = [[ASDKDefaultDocumentViewController alloc] init];

2. Add it to the view controller of a window in the application’s view hierarchy, ensuring that it
displays within that window:

UIViewController *rootViewController =
[UIApplication sharedApplication].keyWindow.rootViewController;
dvc.view.frame = rootViewController.view.bounds;
dvc.view.autoresizingMask =
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[rootViewController addChildViewController:dvc];
[rootViewController.view addSubview: dvc.view];
[dvc didMoveToParentViewController:rootViewController];

3. Pass this class to startSupport in the configuration:

NSMutableDictionary* config = [[NSMutableDictionary alloc] init];

config[@"documentViewController"] = dvc;

[AssistSDK startSupport:server supportParameters:config];

4. Re-arrange the view hierarchy when required:

// Make 'otherView' appear above shared documents.


UIView *otherView=......
[rootViewController.view bringSubviewToFront:otherView];

If the application supplies the ASDKDefaultDocumentViewController as shown above, then it is


the application’s responsibility to dismiss it when required. Typically, this would be done when the
call ends:

- (void) supportCallDidEnd {
[dvc willMoveToParentViewController:nil];
[dvc.view removeFromSuperview];
[dvc removeFromParentViewController];
}

Setting Shared Document View Constraints

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 34


The application may control which portion of the screen is used to display shared documents and
images by setting the documentViewConstraints configuration property (see the Session
Configuration section); it should set the property to an object of a class conforming to the
ASDKDocumentViewConstraints protocol. The class has four methods: leftMargin, rightMargin,
topMargin, and bottomMargin. Each of these methods takes no arguments, and returns a float. If
required, you can create properties using the @property directive, and let the compiler generate
the methods for you:

#import <Foundation/Foundation.h>
@import AssistSDK;

@interface DocumentViewConstraints : NSObject<ASDKDocumentViewConstraints>

@property (nonatomic, assign) float leftMargin;


@property (nonatomic, assign) float rightMargin;
@property (nonatomic, assign) float topMargin;
@property (nonatomic, assign) float bottomMargin;

- (id)initWithLeftMargin:(float)leftMargin rightMargin:(float)rightMargin
topMargin:(float)topMargin bottomMargin:(float)bottomMargin;

@end

@implementation DocumentViewConstraints

- (id)initWithLeftMargin:(float)leftMargin rightMargin:(float)rightMargin
topMargin:(float)topMargin bottomMargin:(float)bottomMargin
{
if (self = [super init]) {
self.leftMargin = leftMargin;
self.rightMargin = rightMargin;
self.topMargin = topMargin;
self.bottomMargin = bottomMargin;
}
return self;
}
@end

And to use it:

DocumentViewConstraints *constraints - [[DocumentViewContraints alloc]


initWithLeftMargin:30 rightMargin:250 topMargin:250 bottomMargin:15];

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 35


NSMutableDictionary *config = [[NSMutableDictionary alloc] init];

config[@"documentViewConstraints"] = dictionary;

[AssistSDK startSupport:server supportParameters:config];

Pre-Processor Macros

The DocType enumeration normally contains the values PDF, Image, Link, and Unknown. If this
is inconvenient (for instance, if one or more of these values is defined elsewhere), you can
define the pre-processor macro USE_ASDK_DOCUMENT_TYPES, in which case DocType will
contain ASDKPDF, ASDKImage, ASDKLink, and ASDKUnknown, respectively.

To use it:

1. Open up Targets in your project

2. Add your pre-processor to the pre-processing phase in the Build Settings tab:

Annotations

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 define a class which conforms to the AssistSDKAnnotationDelegate protocol and
add it to AssistSDK using addDelegate:

@interface AnnotationController : AssistSDKAnnotationDelegate


@end

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 36


@implementation AnnotationController {
}

- (void) start : (NSString*) server {


[AssistSDK addDelegate:self];
}

@end

The AssistSDKAnnotationDelegate offers:

Notification of new annotations received

Notification of annotations cleared

See the AssistSDKAnnotationDelegate section.

Notification of Annotations Received


The two methods assistSDKWillAddAnnotation and assistSDKDidAddAnnotation are called
when the agent sends an annotation to the consumer. The notification parameter for both
methods has an object which is an NSMutableDictionary with the following members:

Key Value Class Description

The path which will be added as an


kASDKSVGPathKey UIBezierPath
annotation

The layer containing the annotation which


kASDKSVGLayerKey CAShapeLayer
will be displayed

kASDKSVGPathStrokeKey UIColor The color of the annotation

kASDKSVGPathStroke A number giving the width of the line of


NSNumber
WidthKey the annotation

kASDKSVGPathStroke A number between 0.0 and 1.0 indicating


NSNumber
OpacityKey the opacity of the annotation

The userInfo dictionary is used for ancillary data.

The CAShapeLayer is created and initialized from the other attributes between the calls to the
Will and Did callbacks. Any values changed in the Will callback are used in the initialization. To

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 37


change the color of the annotation to purple:

- (void) assistSdkWillAddAnnotation:(NSNotification*)notification {
NSMutableDictionary* dic = [notification object];
dic[@"kASDKSVGPathStrokeKey"] = [UIColor purpleColor];
}

To affect the display in the Did callback, the application must manipulate the CAShapeLayer
directly:

- (void) assistSdkDidAddAnnotation:(NSNotification*)notification {

NSMutableDictionary* dic = [notification object];


CAShapeLayer* layer = dic[@"kASDKSVGLayerKey"];
CGColor* purple = [[UIColor purpleColor] CGColor];

[layer setStrokeColor:purple];
}

Notification of Annotations Cleared

To get notification when the agent clears the annotations, implement the
assistSDKDidClearAnnotations method.

The object of the notification parameter is an array of CAShapeLayer instances which have been
cleared. The dictionary used to create the layer is no longer available, but the layer could contain
metadata placed on it in the assistSDKDidAddAnnotation callback:

- (void) assistDidAddAnnotation: (NSNotification*)notification {

NSMutableDictionary* dic = [notification object];


CAShapeLayer* layer = dic[@"kASDKSVGLayerKey"];

[layer setValue:@"agent1" forKey:@"agentName"];


}

- (void) assistSDKDidClearAnnotations: (NSNotification*)notification {

CAShapeLayer* layer = [notification object];


NSString* agent = [layer valueForKey: @"agentName"];

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 38


NSLog(@"Layer from %@ cleared", agent);
}

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 UIButton, UISlider,
UISwitch, UIStepper, or UIDatePicker controls, and relays these forms to the agent so that the
agent can fill in values for the user. You must provide each element with a unique Label attribute,
either in the Interface Builder or programmatically (if you are adding the controls
programmatically).

The SDK automatically prevents the agent from filling in the field if the secureTextEntry attribute
is set to true, or Secure is specified in the Interface Builder.

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 control (see the Excluding Elements from Co-
browsing section).

Excluding Elements from Co-browsing

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.

In the CBA Live Assist iOS SDK, you can mark the UI element with a specific tag value. Do this
in Xcode by opening the Attribute Inspector, then opening the View panel for the UI elements to
exclude and entering them in the Tag field:

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 39


The tag value is an arbitrary numeric value. The application can hide or mask all controls with
that tag value by passing it in the hidingTags or maskingTags members of the
supportParameters when it calls startSupport (see the Session Configuration section).

Use of a unique tag value to obscure elements

In this scenario, the same tag value is used to mark all the elements that need to be obscured;
these elements appear on the agent console as black rectangles. To do this, submit the single
tag value as an argument of the hidingTags member of the supportParameters:

NSSet *tags = [NSSet setWithObjects: [NSNumber numberWithInteger:100], nil];


NSMutableDictionary *config= [[NSMutableDictionary alloc] init];

config[@"hidingTags"] = tags;

[AssistSDK startSupport: @"server.test.com" supportParameters:config];

Use of multiple tag values to hide elements

Some applications already use the UIView tag value, and require each UI component to use a
unique value. Add the pre-existing tag values of those elements which you want to hide to an
NSSet which you add to the configuration argument when calling the startSupport method:

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 40


NSSet *tags = [NSSet setWithObjects: [NSNumber numberWithInteger:100],
[NSNumber numberWithInteger:200], nil];
NSMutableDictionary *config= [[NSMutableDictionary alloc] init];

config[@"hidingTags"] = tags;

[AssistSDK startSupport: @"server.test.com" supportParameters: config];

Masking elements

In addition to obscuring elements with black boxes, you can also mask elements using the
maskingTags configuration property (see the Session Configuration section); in this case the
masked elements appear as solid rectangles in the agent console. By default, the rectangles
appear black in the agent console, but this color can be changed using the maskColor
configuration property. Like hidingTags, the value of the maskingTags property must be an object
of type NSSet, which contains objects of type NSNumber that are constructed from integers. The
value of the maskColor property must be an object of type UIColor:

NSSet *tags = [NSSet setWithObjects: [NSNumber numberWithInteger:150],


[NSNumber numberWithInteger:151], nil];
NSMutableDictionary *config= [[NSMutableDictionary alloc] init];

config[@"maskingTags"] = tags;
config[@"maskColor"] = [UIColor redColor];

[AssistSDK startSupport: @"server.test.com" supportParameters: config];

Note: The sub-elements of any hidden or masked element are also implicitly hidden or masked.

For more detailed control over element visibility, see the Permissions section.

Note: If you are using a UIWebView or WKWebView, and using HTML elements on that web
view, you can use the methods described in the CBA Live Assist Web Developer Guide to
mask individual elements, or you can use the above techniques to mask the whole page. You
can also set permissions on the elements (see the Permissions in Web Views section). However,
if the elements are contained in a iframe which is contained in an HTML page which is loaded
into a UIWebView or WKWebView, they will not be masked.

Snapshots

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 41


iOS devices have a feature called Snapshot, which allows the user to take a screenshot and
share it. If the consumer takes a screenshot and shares it (using the Use Photo button, or
similar), the agent receives a notification from the CBA Live Assist Agent SDK (see the CBA
Live Assist Agent Console Developer Guide).

Note: This is not strictly a CBA Live Assist iOS SDK feature, as doing it needs no interaction
with the CBA Live Assist iOS SDK (apart from calling startSupport). However, developers
should be aware of it.

WebSocket Reconnection Control

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
one or both of the following when the application calls startSupport (see the Session
Configuration section):

Connection configuration

An instance of a delegate which conforms to ASDKConnectionStatusDelegate, allowing an


application to perform its own reconnection handling, or to simply inform the user of the
status of the current connection.

Connection Configuration

You can use the optional configuration items retryIntervals, maxReconnectTimeouts, and
initialConnectTimeout to control connection and reconnection behavior (see the Session
Configuration section):

NSMutableDictionary config = [[NSMutableDictionary alloc] init];

config[@"retryIntervals"] = @[@5.0f,@10.0f,@15.0f];
config[@"maxReconnectTimeouts"] = @[@0.1f,@1.0f,@10.0f];
config[@"initialConnectTimeout"] = [NSNumber numberWithFloat:30.0f];

[AssistSDK startSupport: @"server.test.com" supportParameters: config];

If the WebSocket connection to the CBA Live Assist server goes down, CBA Live Assist tries
to re-establish the connection to the server the number of times specified in the retryIntervals
array, with the specified time in seconds between them. The above example sets a timeout for
the initial connection of 30 seconds; if the connection is lost, it tries to reconnect 3 times, at

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 42


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. Note:

If you do not specify retryIntervals in the supportParameters, CBA Live Assist uses its
default values, which are [@1.0f, @2.0f, @4.0f, @8.0f, @16.0f, @32.0f]. If you specify an
empty array, CBA Live Assist makes no reconnection attempts.

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.

Connection Status Delegate


If the default reconnection behavior of CBA Live Assist is not what you want, even after
changing the configuration, you can supply an instance of a class which conforms to
ASDKConnectionStatusDelegate to implement your own reconnection logic, and include it in the
supportParameters passed to startSupport - see the Session Configuration section and the
ASDKConnectionStatusDelegate section for details.

Note: If you do not specify retryIntervals or maxReconnectionTimeouts in supportParameters,


CBA Live Assist will use its default reconnection behavior; if you specify retryIntervals and
maxReconnectionTimeouts in supportParameters, CBA Live Assist will use its default
reconnection behavior using those values. You can turn off the default reconnection behavior,
and take full control of reconnection, by specifying an empty list for retryIntervals.

When implementing your own reconnection logic, the most important notifications you receive
are onDisconnect (called whenever the connection is lost) and willRetry (called when automatic
reconnection is occurring, and there are more reconnection attempts to come). Both these
methods include an ASDKConnector object in their parameters. You can use the
ASDKConnector object to make a reconnection attempt (by calling reconnect), or to terminate all
reconnection attempts (by calling terminate). The ASDKConnector object remains valid after the
call has ended, so the application can also hold onto it for use elsewhere.

Method Description

onDisconnect Received when the WebSocket connection to the CBA Live Assist server
has been lost, or has failed to reconnect.
This method is called regardless of whether retryIntervals is specified (that
is, whether automatic reconnection is active or not).
The ASDKConnector object allows the implementing class to control
reconnection, even if reconnection is automatic. For example, an

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 43


application might decide to give up reconnection attempts even if more
reconnection attempts would normally occur, or to try the next
reconnection attempt immediately without waiting until the next retry
interval has passed.
Note: The only error this method receives is a transportation error if the
network has gone down.

Called under the following conditions:


• when the WebSocket connection is lost; or
• when a reconnection attempt fails and automatic reconnections are
occurring (retryIntervals is a non-empty array) and there are more
willRetry
automatic reconnection attempts to be made.
This method is called after the onDisconnect method.
Use the ASDKConnector object to override reconnection behavior. For
example, a reconnect attempt could be made straight away.

Called when a reconnection attempt succeeds.


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.

Called under the following conditions:


• when all reconnection attempts have been made (and failed); or
onTerminated
• when either the [ASDKConnector disconnect] method or [AssistSDK
endSupport] method is called.

Example - make a reconnection attempt immediately on disconnection:

In this example, the default reconnection behavior has been disabled, but the user is able
choose the reconnection behavior by setting the reconnection_type flag. In one case, it makes a
reconnection attempt immediately; in another, it terminates all reconnection attempts; otherwise,
it starts a timer to reconnect in 5 seconds:

ASDKConnector* reconnector;
int reconnection_type;

- (void) onDisconnect:(NSError *) reason connector:(ASDKConnector*)connector {


switch (reconnection_type) {
case RECONNECT_IMMEDIATELY:
[connector reconnect:2.0f];
break;

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 44


case DO_NOT_RECONNECT:
[connector terminate:reason];
break;
default:
// Start timer for reconnection
reconnector = connector;
[NSTimer sceduledTimerWithTimeInterval:5.0f target:self
selector:@selector(reconnect) userInfo:nil repeats:NO];
break;
}
}

- (void) reconnect {
[reconnector reconnect:5.0f];
}

Example - terminate reconnection attempts in response to user command:

In this example, the default reconnection behavior has not been disabled, but there is a UI
control which the user can use to change the maximum number of reconnection attempts. When
that maximum number has been reached, reconnection attempts are terminated:

- (void) willRetry:(float) inSeconds attempt:(int) attempt of:(int) maxAttempts


connector:(ASDKConnector*) connector {
if (attempt > userMaxAttempts) {
[connector terminate: [[NSError alloc] init @"UserAction" code: -1]];
}
}

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 45


Cookies
By default, CBA Live Assist does not include cookies on the WebSocket connection that it
opens to the CBA Live Assist server. If the WebSocket needs to include all the appropriate
cookies for the WebSocket URL, you can enable them by providing a useCookies configuration
parameter set to @YES (see the Session Configuration section).

CBA Live Assist uses the cookies stored in the NSHTTPCookieStorage class provided by iOS,
so any cookies which should apply to the WebSocket must be in the NSHTTPCookieStorage
singleton before invoking startSupport. CBA Live Assist uses the cookiesForURL method of
NSHTTPCookieStorage to obtain the collection of applicable cookies for the WebSocket.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 46


Permissions
You can use permissions to prevent an agent from interacting with, or even seeing, a UI control.
Whether an agent can see a particular control or not depends upon both the agent’s and the
control element’s permissions.

Control element permissions

Client applications assign permission markers to UI control elements by calling the


setPermission class method of the AssistSDK:

[AssistSDK setPermission: @"X" forView: control)];

where X is the permission marker to be set on the 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.

The default permission is explained further in the Default Permission section.

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 ASDKAgent object it receives in
the methods of the ASDKAgentCobrowseDelegate (see the ASDKAgentCobrowseDelegate
section). If the application needs to examine this, but if it does (for instance, to notify the
consumer that a particular control will not be visible to the agent), use the viewable and
interactive values in the agent’s agentPermissions dictionary.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 47


NSSet* viewable = agent.agentPermissions[@"viewable"];

Note: If the agent specifies permissions in the Session Token Description, but leaves both
the viewable set and interactive set empty, the agent will end up with no permissions, not even
the default permission.

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 and Element Permissions

Permissions are compound such that:

Agent Agent
Permission
viewable interactive
marker on Result
permission permission
element
set set

Agent can view and interact with


X [“X”] [“X”]
an element marked with X.

Agent can view the element


X [“X”] [] marked with X but cannot interact
with it.

X [] [“X”] Agent can neither view nor interact


with the element, because it does

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 48


not have X in its viewable set. (In
order to interact with an element,
and agent must first be able to
view it.)

Element marked with X is masked


or redacted, as Agent does not
X [] []
have the X permission in its
viewable or interactive set.

Element marked with X is masked


or redacted, because Agent does
X [“default”] [“default”]
not have the X permission in its
viewable or interactive set.

Agent can neither view nor interact


X [“default”] [“X”] with the element, because it does
not have X in its viewable set.

Agent can view the element,


because it has the X permission in
its viewable set; it cannot interact
X [“X”] [“default”]
with it, because it does not have
the X permission in its interactive
set.

Element marked with B is masked


or redacted, because Agent has X
B [“X”] [“X”]
permission and not B in their
permission set.

Agent can view and interact with


the element because they have the
default permission in their viewable
[“X”,“default”] [“X”,“default”]
and interactive sets, and the
element implicitly has the default
permission.

Element is masked or redacted,


[“X”] [“X”] because Agent’s sets do not
contain the default permission

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 49


Agent can view and interact with
the element, because they have
[“default”] [“default”]
the default permission set for their
viewable and interactive set.

Element is masked or redacted,


[] [] because Agent’s sets do not
contains default permission

Agent can see the element


because they have the default
permission in their viewable set.
[“default”] [“X”] They cannot interact with it
because they do not have the
default permission in their
interactive set.

Element is masked or redacted


because the agent’s viewable set
does not contain B. The agent may
B [“X”] [“B”] not interact with an element which
they cannot see, even though they
have the appropriate permission in
their interactive permission set.

Element is viewable, because the


agent’s viewable set contains B;
B [“B”] [“X”] the element is not interactive, as
the agent’s interactive set does not
contain B.

An agent is granted a permission if a permission (such as A, B, or X) configured in their Session


Description matches the permission-marker of the UI element in the application.

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.

Parent and Child Permissions

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 50


An element can also inherit permissions through the UI hierarchy: UI elements that are a child of
a parent UI element inherit the permission marker of the parent, unless the child specifies a
permission marker of its own.

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.

Permission Permission Agent Agent


marker set marker set viewable interactive
Result
on parent on child permission permission
element element set set

Agent can view and


interact with both
A [“A”] [“A”] parent and child
element. Child inherits
permission marker A.

Agent can view and


interact with both
A A [“A”] [“A”]
parent and child
element.

Agent cannot view or


A B [“A”] [“A”] interact with child
element marked with B.

Agent can view child


A B [“A”,“B”] [“A”] element but cannot
interact with it

Agent can view and


interact with the child
A B [“A”,“B”] [“B”]
element but cannot
interact with the parent.

A B [“B”] [“B”] Agent cannot view or


interact with child or

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 51


parent element as they
do not have the
parent’s permission
marker in their viewable
permission set. The
agent may not interact
with an element which
they cannot see, even
though they have the
appropriate permission
in their interactive
permission set.

Agent can view and


interact with both
parent and child
elements as they have
the default permission
[“default”] [“default”] in their viewable and
interactive permission
sets, and both parent
and child elements
implicitly have the
default permission.

B [“B”] [“B”] Agent cannot view or


interact with child
element, because the
parent has an implicit
default permission
marker, and they do not
have the default
permission in their
viewable permission
set. The agent may not
interact with an element
which they cannot see,
even though they have
the appropriate
permission in their

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 52


interactive permission
set.

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 in the viewable or interactive
sets of the agent object’s agentPermissions).

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.

Permissions in Web Views

The application can add permissions to HTML elements on a web page loaded with UIWebView
or WKWebView. To do this, call:

[AssistSDK setPermission: @"X" for WebElementWithId: @"ELEMENTID"];

where X is the permission marker to be set, and ELEMENTID is the ID of the web page
element. This method provides similar functionality for web pages loaded in UIWebView or
WKWebView as is provided for native iOS controls.

The application can remove all the permissions from all the elements on an HTML page by
calling:

[AssistSDK resetAllWebPermissions];

Note: The application cannot set permissions on elements within an iframe in an HTML page
loaded into a UIWebView or WKWebView; nor will elements in an iframe which have the assist-
no-show class (see the CBA Live Assist Web Developer Guide) be masked.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 53


Internationalization
Currently, there is no internationalization support in the CBA Live Assist SDK . We suggest that
the application should supply its own implementations of those delegates which result in a
default UI, and use them to show its own (internationalized) UI:

- (void) cobrowseActiveDidChangeTo: (BOOL)active


{
if (active) {
[self displayCobrowseNotification];
} else {
[self removeCobrowseNotification];
}
}
- (void) displayCobrowseNotification
{
NSString message = NSLocalizedString(@"cobrowse-message", nil);

- (void) removeCobrowseNotification
{

where we assume that the internationalized text for the co-browse message in the current
language exists. The application is responsible for displaying the internationalized string to the
user in whatever way it likes.

The following delegates show a default UI, and an internationalized application needs to
implement them:

AssistSDKDelegate

ASDKScreenShareRequestedDelegate

ASDKPushAuthorizationDelegate

ASDKAgentCobrowseDelegate

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 54


Integrating with FCSDK
When you call the AssistSDK startSupport method and provide a destination, but no correlationId
or sessionToken, in the supportParameters, CBA Live Assist automatically starts a voice and
video call and a co-browse session with the agent, and automatically ends the call when the
application calls AssistSDK endSupport. If you want more control over the voice and video call
than this, then you need to start the call using the FCSDK:

- (void) initialize
{
NSString* sessionId = [self getSessionId];
ACBUC* uc = [ACBUC ucWithConfiguration:sessionId delegate:self];
[uc startSession];
}

- (void) ucDidStartSession:(ACBUC *)uc


{
ACBClientPhone* phone = uc.phone;

ACBClientCall* call = [phone createCallToAddress:calleeAddress


withAudio:ACBMediaDirectionSendAndReceive
withVideo:ACBMediaDirectionSendAndReceive delegate:self];

- (void) call: (ACBClientCall*)call didChangeStatus:(ACBClientCallStatus)


status
{

if (status == ACBClientCallStatusInCall)
{
// Escalate call to co-bowse
}
}

After the call is connected, you need to escalate that call to co-browse (see the Escalating a Call
to Include Co-browse section). In order to control the call while it is in progress, the application
saves the ACBClientCall object returned by createCallToAddress, so that it can use it when
needed. For convenience of illustration, self represents the two delegates which receive
information on the progress of session creation and call setup.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 55


See the FCSDK Developer Guide for more details of how to set up a call, and in particular, of
how to obtain a session token to use as the sessionId. It also gives details of what call control
features are available and how to use them.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 56


Using CBA Live Assist without Voice and
Video
You can use CBA Live Assist in co-browse only mode, if the voice or video call is provided
independently of Fusion Client SDK and CBA Live Assist, or when something like a chat
session is used instead of a voice and video call.

To prevent CBA Live Assist from placing a call using the Fusion Client SDK, the application
should provide a correlation ID that CBA Live Assist uses to correlate the consumer and agent
sides of the co-browsing session. This allows an application to use the features of CBA Live
Assist (for example, co-browsing, document push, annotation, and remote control) without voice
or video.

To create a CBA Live Assist session without voice and video, provide a correlation ID in the
supportParameters which you pass to startSupport:

NSMutableDictionary* config = [[NSMutableDictionary alloc] init];

config[@"correlationId"] = @"correlation-123";

[AssistSDK startSupport: @"server.test.com" supportParameters: config];

In this case, you should not supply a destination in the supportParameters. Note:

In a co-browse only session, the application must explicitly call endSupport when the call
ends (or when the co-browse session is no longer needed), as CBA Live Assist does not
present its default UI to the user.

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.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 57


Informing the Agent of the Correlation ID

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.

Including a Second Agent

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

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 58


correlation ID of the CBA Live Assist session, and can use it in the initial call to the REST
service, to associate that correlation ID with a newly created short code:

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.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 59


Consumer Session Creation
A client application needs an FCSDK Web Gateway session token and a correlation ID to
establish a co-browsing session. When the application calls startSupport, CBA Live Assist uses
a built-in mechanism to create a session token for the voice and video call, and associates it with
a correlation ID for the co-browse. The built-in mechanism provides a standalone, secure
mechanism for creating a session token and a correlation ID, but the process is not integrated
with any pre-existing authentication and authorization system, and assumes that if a client can
invoke startSupport, it is permitted to do so.

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.

Session Token Creation

A bespoke implementation needs the following general steps:

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).

3. Add CBA Live Assist-specific data to the session description:

AED2.metadata.role

This should be set to consumer

AED2.metadata.auditName

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 60


Optional name to use to identify the consumer in event log entries (see the CBA Live
Assist Overview and Installation Guide for details about event logging.

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
needed, and there is no voice section, then there must be an aed section as well as the AED2
section entries.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 61


© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 62
Error Codes
Code Value Meaning

The dialed number could not be


ASDKERRCalleeNotFound 20101
found

The callee was unable to answer the


ASDKERRCalleeBusy 20102
call.

ASDKERRCallCreationFailed 20103 The creation of the call failed

The callee did not answer the call


ASDKERRCallTimeout 20104
within the network’s timeout

ASDKERRCallFailed 20105 The call failed to complete

Failed to establish a Client SDK


ASDKERRSessionFailure 20106
session for voice and video

The user did not give permission to


ASDKERRCameraNotAuthorized 20107
use the device’s camera

The user did not give permission to


ASDKERRMicrophoneNotAuthorized 20108
use the device’s microphone

The Assist session failed to be


ASDKERRAssistSessionCreationFailure 30101
created

ASDKERRAssistTransportFailure 30102 Network error

ASDKERRAssistSessionInProgress 30103 There is already a session in use

ASDKERRAssistConsumerDocument Attempt to share a screen when


40101
ShareFailedNotScreenSharing screen sharing is not active

The endSupport method was


explicitly called to end co-browsing
ASDKAssistSupportEnded 50101
(as opposed to co-browsing being
terminated in any other way).

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 63


Alerts and System Dialog Boxes
Due to limitations imposed by iOS, CBA Live Assist cannot replicate any iOS-generated dialog
boxes, such as Alert boxes, the iOS keyboard, or menus generated by HTML (for example, the
popup menu generated by the HTML <select> element), to the agent. Instead, consider
alternative implementations, such as JavaScript and CSS.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 64


Accepting Self-Signed Certificates
By default, self-signed security certificates are rejected by the iOS SDK. If you wish to accept
self signed certificates, set the acceptSelfSignedCerts configuration parameter to @YES (see
the Session Configuration section).

We recommend that you restrict this mode to debug builds. By default, Xcode uses the debug
mode for a local run, but uses the release mode for anything pushed to the App Store or an
enterprise server. Doing this automatically restricts acceptance of self-signed certificates:

NSMutableDictionary *config = [[NSMutableDictionary alloc] init];

#ifdef DEBUG
config[@"acceptSelfSignedCerts"] = @YES;
#endif

[AssistSDK startSupport:server supportParameters:config];

Note: CBA Live Assist supports applications built using XCode 12 for deployment to devices
running iOS 12; however, App Transport Security (ATS) causes all insecure traffic to be blocked
or disabled, which includes both HTTP traffic and HTTPS traffic to a server using self-signed
certificates. To test or develop against a development installation of the CBA Live Assist server,
disable ATS by adding the following property to the project plist file:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 65


Password Fields
When entering a password into a text field on an iOS device, it briefly displays the character that
has been entered before masking it. As a user’s device screen is being replicated and displayed
to an agent, the agent may be able to see the password as it is being entered. Consequently, we
recommend that you mask fields that can contain sensitive information using the built-in masking
capabilities provided by the CBA Live Assist SDK (see the Excluding Elements from Co-
browsing section).

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 66


IPv6 Support
With the release of iOS 9, Apple have made IPv6 support mandatory for App Store submissions.
OS X 10.11 (El Capitan) provides the ability to create an IPv6 only Wi-Fi hotspot, which mobile
devices can connect to during testing.

The Apple Developer document, UnderstandingandPreparingfortheIPv6Transition, is a useful


resource explaining how to set up such a network, and things to consider when ensuring your
application operates in an IPv6-only network .

Use the following steps to test a CBA Live Assist-enabled application in an IPv6-enabled
network:

1. Set up an IPv6-only Wi-Fi hotspot using the built-in utility, as described above.

2. Connect to this network from a computer, and obtain the IPv6 address of your CBA Live
Assist cluster by running the following command:

Linux: ping6 FQDN-address-of-cluster

Windows: ping -6 FQDN-address-of-cluster

3. Connect your Apple mobile device to the hotspot.

4. Have your application pass in an IPv6 address or URL (as returned from ping6), or the
FQDN of your CBA Live Assist cluster, as the server parameter of your call to startSupport.

Note: An IPv6 server address or URL passed as a server argument must be surrounded by [ ]
regardless of whether the server is a URL, or just an address, or whether a port is specified. For
example [fe80::7aca:39ff:feb4:1002]:8080. This does not apply when using an FQDN.

© 2023 CBA | All Rights Reserved | Unauthorized use prohibited. Page 67

You might also like