Package io.cobrowse
Class CobrowseIO
java.lang.Object
io.cobrowse.CobrowseIO
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceImplement this interface to customise the behaviour of Cobrowse.static interfaceImplement this interface on your delegate to implement your own logic for handling full device requests.static interfaceImplement this interface on your Activity subclasses to provide a list of views used in that activity that should be removed from the agents view.static interfaceImplement this interface on your delegate to redact certain views from the frames leaving the devicestatic interfaceImplement this interface on your delegate to override the default logic for handling remote control requests.static interfaceImplement this interface on your delegate to get callbacks for when to show or hide your custom session indicators and controls.static interfaceImplement this interface on your delegate to listen for session load events.static interfaceImplement this interface on your delegate to override the default logic for handling incoming session requests.static interfaceImplement this interface on your Activity subclasses to provide a list of views used in that activity that should be shown on the agents view.static interfaceImplement this interface on your delegate to unredact certain views from the frames leaving the device. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionapi()voidConfigure the SDK to use an enterprise deployment APIString[]voidcapabilities(String[] capabilities) Sets the available capabilities for a session.voidcreateSession(Callback<Error, Session> callback) Creates a new screenshare session.Gets the current screenshare session.voidcustomData(Map<String, Object> customData) Sets metadata attached to this device that will be displayed and filterable in the web dashboard.deviceId()Returns the unique device ID generated by the Cobrowse SDKdeviceId(android.app.Application app) Deprecated.The Application parameter is ignored.voidgetSession(String idOrCode, Callback<Error, Session> callback) Fetches a session by its ID or by a 6 digit code.static CobrowseIOinstance()The main CobrowseIO singleton APIstatic BooleanisCobrowseNotification(Map<String, String> data) Tests whether a push notification was generated by Cobrowse.license()voidSets the Cobrowse license (available via the web dashboard).voidonPushNotification(Map<String, String> data) Call this when your Firebase handler receives a push notification.String[]voidredactedViews(String[] selectors) Sets the selectors which will be used to redact views.booleanvoidregistration(boolean registration) By default, when the SDK starts it will register the device to your account and share its connectivity state.voidsetDelegate(CobrowseIO.Delegate delegate) Sets the CobrowseIO.Delegate that enables you to customise many of the elements and behaviours of the CobrowseSDKvoidsetDeviceToken(android.app.Application app, String token) Deprecated.The Application parameter is ignored.voidsetDeviceToken(String token) Sets the device native channel push notification token, i.e.voidstart()Call start() when you have configured Cobrowse and would like to start accepting incoming session requests.voidstart(android.app.Activity currentActivity) Deprecated.The Activity parameter is ignored.voidstart(android.app.Application application) Deprecated.The Application parameter is ignored.voidstop()Stops Cobrowse, de-registering the device from the server and closing any open connections.String[]voidunredactedViews(String[] selectors) Sets the selectors which will be used to unredact views.String[]voidwebviewRedactedViews(String[] redactionSelectors) Sets the CSS selectors which will be used to redact content within WebViews.
-
Field Details
-
USER_ID_KEY
- See Also:
-
USER_NAME_KEY
- See Also:
-
USER_EMAIL_KEY
- See Also:
-
DEVICE_NAME_KEY
- See Also:
-
DEVICE_ID_KEY
- See Also:
-
-
Method Details
-
instance
The main CobrowseIO singleton API- Returns:
- The CobrowseIO public API
-
deviceId
Deprecated.The Application parameter is ignored. Use the parameterlessdeviceId()method instead.Returns the unique device ID generated by the Cobrowse SDK- Parameters:
app- The Application object- Returns:
- The device ID
-
deviceId
Returns the unique device ID generated by the Cobrowse SDK- Returns:
- The device ID
-
setDelegate
Sets the CobrowseIO.Delegate that enables you to customise many of the elements and behaviours of the CobrowseSDK- Parameters:
delegate- Your delegate implementation
-
currentSession
Gets the current screenshare session. This may be a session waiting to start, the currently active session, or may be null if no session has been created.- Returns:
- The current session
-
createSession
Creates a new screenshare session. Sessions will start in a 'pending' state. To activate a session an agent must have joined and all required consent given by the user. Pending sessions contain a six digit "code()" that can be displayed for the user to give to a support agent.- Parameters:
callback- A callback containing the created session, or an error.
-
getSession
Fetches a session by its ID or by a 6 digit code. When loaded the callback will be invoked with the session object, or an error if the session could not be fetched.- Parameters:
idOrCode- A session ID, or a 6 digit code.callback- A callback containing the created session, or an error.
-
license
-
license
Sets the Cobrowse license (available via the web dashboard).- Parameters:
license- Your license key
-
api
-
api
Configure the SDK to use an enterprise deployment API- Parameters:
api- Your deployments URL
-
registration
public void registration(boolean registration) By default, when the SDK starts it will register the device to your account and share its connectivity state. This provides the dashboard with a list of devices which are online and ready to connect.If you don't need to see a list of devices in your dashboard, e.g. your sessions start only using
CobrowseActivity, then you can stop the SDK from registering the device and its status by passing theregistrationoption with a value offalse.- Parameters:
registration- Controls whether the device should automatically register on the dashboard.
-
registration
public boolean registration()- Returns:
- A value indicating whether the device should automatically register on the dashboard.
-
start
public void start()Call start() when you have configured Cobrowse and would like to start accepting incoming session requests. Calling start will register the device into your cobrowse dashboard and open a socket to accept incoming connection requests from your support agents.You can delay this call until just before you need Cobrowse to run if you wish. For example, when using 6 digit code initiated sessions you may choose to call start only when your UI to show the code is about to be presented. Note: You must call start() before you can generate a 6 digit code.
- See Also:
-
start
Deprecated.The Application parameter is ignored. Use the parameterlessstart()method instead.Call start() when you have configured Cobrowse and would like to start accepting incoming session requests.- Parameters:
application- The Application object
-
start
Deprecated.The Activity parameter is ignored. Use the parameterlessstart()method instead.Call start() when you have configured Cobrowse and would like to start accepting incoming session requests.- Parameters:
currentActivity- The currently displayed activity
-
stop
public void stop()Stops Cobrowse, de-registering the device from the server and closing any open connections. After this method has been called you can no longer start sessions either via the dashboard, or via a 6 digit code, until Cobrowse has been start()ed again.- See Also:
-
customData
Sets metadata attached to this device that will be displayed and filterable in the web dashboard. This allows you to find and identify your users devices quickly. We recommend adding information such as your logged in users email addresses or user IDs here.- Parameters:
customData- Custom data to attach to the device record
-
customData
-
capabilities
Sets the available capabilities for a session. Different annotation tools and events will be available during a session depending on the capabilities you set here. By default all capabilities supported by the device are enabled.- Parameters:
capabilities- Array of capabilities to allow
-
capabilities
-
redactedViews
Sets the selectors which will be used to redact views. To pass the views directly rather than passing in String selectors, use the Redaction delegate methods.- Parameters:
selectors- Array of CSS-like selectors that define views to redact
-
redactedViews
-
unredactedViews
Sets the selectors which will be used to unredact views. To pass the views directly rather than passing in String selectors, use the Unredaction delegate methods.- Parameters:
selectors- Array of CSS-like selectors that define views to redact
-
unredactedViews
-
webviewRedactedViews
Sets the CSS selectors which will be used to redact content within WebViews. Any HTML element matching one of the selectors configured here will be redacted and not visible to your agents. Defaults to an empty list which means the feature is disabled.- Parameters:
redactionSelectors- Array of CSS selectors to redact within WebViews
-
webviewRedactedViews
-
setDeviceToken
Deprecated.The Application parameter is ignored. Use the parameterlesssetDeviceToken(String)()} method instead.Sets the device native channel push notification token, i.e. Firebase token. This is only required if you are using our Firebase push support.- Parameters:
app- The Application objecttoken- Your FCM token
-
setDeviceToken
Sets the device native channel push notification token, i.e. Firebase token. This is only required if you are using our Firebase push support.- Parameters:
token- Your FCM token
-
onPushNotification
Call this when your Firebase handler receives a push notification. Non-cobrowse push notifications will be ignored.- Parameters:
data- The notification data
-
isCobrowseNotification
Tests whether a push notification was generated by Cobrowse.- Parameters:
data- The push notification data- Returns:
- True if it looks like a Cobrowse notification
-