Interface MobileCoBrowsingModule
- All Superinterfaces:
UnbluModule
MobileCoBrowsingModuleProvider.create().
The API is only usable if the corresponding module was registered in the configuration of the UnbluClient.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddPrivateView(int id) Adds the view with the given ID to the Set of private views.booleanvoidRemoves the private area with the given ID.voidremovePrivateView(int id) Removes the view with the given ID from the Set of private views.voidsetAgentMarkerVisibleOutsideApp(boolean enabled) Controls whether the agent's marker is shown on top of other apps while co-browsing outside the app (only relevant inCoBrowsingCaptureMode.MEDIA_PROJECTION).voidSelects how the screen is captured during mobile co-browsing: normal foreground-only capture (CoBrowsingCaptureMode.SCREENSHOT, the default) or MediaProjection-based capture that keeps working while the app is backgrounded (CoBrowsingCaptureMode.MEDIA_PROJECTION).voidSets anIndicatorButtonClickInterceptoron the module.voidsetCoBrowsingIndicatorIcon(UnbluImageResourceWrapper indicatorIcon) Sets the icon used as a floating indicator within the application's user interface.setPrivateArea(String id, int x, int y, int width, int height) Adds or updates a private area with the given size and position.voidsetReturnToConversationButtonVisible(boolean visible) Controls whether the "Return to conversation" option is shown in the co-browsing indicator dialog.
-
Method Details
-
addPrivateView
void addPrivateView(int id) Adds the view with the given ID to the Set of private views.Private views are only visible on the mobile device and aren't transmitted during co-browsing. The views are covered before they're transmitted so they aren't visible on the agent side.
Note:
Each private view requires extra performance while capturing the UI so try to limit the number of private views you add. The best practice is to dynamically make views private when they're displayed in the app UI and remove them from the private view list when they aren't visible anymore.
Multiple calls with the same ID don't have any effect.
- Parameters:
id- ID of the view that should be made private.
-
removePrivateView
void removePrivateView(int id) Removes the view with the given ID from the Set of private views.Multiple calls with the same ID don't have any effect.
- Parameters:
id- ID of the view to remove- See Also:
-
setPrivateArea
Adds or updates a private area with the given size and position.Private areas are only visible on the mobile device and aren't transmitted during co-browsing. The areas are covered before they're transmitted so they aren't visible on the agent side.
To update a private area, either call this function again with the same ID or modify the returned
PrivateArea.
Changes to the returned private area or using this function are applied directly, even if co-browsing is already active.Note:
The number of private areas impacts performance during co-browsing. You should therefore try to keep the number of private areas to a minimum
- Parameters:
id- Unique ID of the private area which can be used to update the values or to remove the private areax- x position on the screen for the private areay- y position on the screen for the private areawidth- Width of the private areaheight- Height of the private area- Returns:
- A
PrivateAreawhich can be updated instead of using this API function - See Also:
-
removePrivateArea
Removes the private area with the given ID.Multiple calls with the ID don't have any effect.
- Parameters:
id- of the area to remove from the private areas- See Also:
-
setCobrowsingIndicatorButtonClickInterceptor
void setCobrowsingIndicatorButtonClickInterceptor(@Nullable IndicatorButtonClickInterceptor interceptor) Sets anIndicatorButtonClickInterceptoron the module.The interceptor is called when the user clicks on a cobrowsing indicator button.
- Parameters:
interceptor- The interceptor to use. If null is passed in, the SDK will always handle the button clicks.
-
setCoBrowsingIndicatorIcon
Sets the icon used as a floating indicator within the application's user interface. This method allows customization of the floating indicator's appearance by specifying an icon wrapped in anUnbluImageResourceWrapper, which can encapsulate various types of image resources, including drawables, ImageVector objects, and URLs.- Parameters:
indicatorIcon- An instance ofUnbluImageResourceWrapperrepresenting the new icon to be used for the floating indicator.
-
setReturnToConversationButtonVisible
void setReturnToConversationButtonVisible(boolean visible) Controls whether the "Return to conversation" option is shown in the co-browsing indicator dialog.Use this for integrations that use mobile co-browsing without the conversation view, where this option is irrelevant and might confuse end users.
Takes effect the next time the dialog is opened. Default:
true(the option is shown).- Parameters:
visible-falseto hide the option,trueto show it.
-
setCaptureMode
Selects how the screen is captured during mobile co-browsing: normal foreground-only capture (CoBrowsingCaptureMode.SCREENSHOT, the default) or MediaProjection-based capture that keeps working while the app is backgrounded (CoBrowsingCaptureMode.MEDIA_PROJECTION).Can be set before or during a session. When set to
MEDIA_PROJECTIONwhile co-browsing is already active, the user is asked to allow screen recording; when set back toSCREENSHOT, MediaProjection capturing is stopped.- Parameters:
mode- the capture mode to use
-
getCaptureMode
- Returns:
- the current co-browsing capture mode (default
CoBrowsingCaptureMode.SCREENSHOT).
-
setAgentMarkerVisibleOutsideApp
void setAgentMarkerVisibleOutsideApp(boolean enabled) Controls whether the agent's marker is shown on top of other apps while co-browsing outside the app (only relevant inCoBrowsingCaptureMode.MEDIA_PROJECTION). If enabled, the "Display over other apps" permission is requested when co-browsing starts. Default:false(the marker is only shown inside the app).- Parameters:
enabled-trueto show the marker over other apps
-
isAgentMarkerVisibleOutsideApp
boolean isAgentMarkerVisibleOutsideApp()- Returns:
- whether the agent marker is configured to be shown over other apps (default
false).
-