You can customize the behavior of the UserView Android SDK through configuration options.
Setting Configuration
Use the UpscopeConfiguration.Builder when initializing the SDK:
val config = UpscopeConfiguration.Builder("YOUR_API_KEY")
.requireAuthorizationForSession(true)
.authorizationPromptTitle("Screen Sharing Request")
.authorizationPromptMessage("Allow {%agentName%|Support} to view your screen?")
.endOfSessionMessage("Thanks for using screen sharing!")
.translationsYes("Allow")
.translationsNo("Decline")
.build()
Upscope.initialize(applicationContext, config)
Configuration Options
Session Authorization
| Option | Type | Default | Description |
|---|
requireAuthorizationForSession | Boolean | Server config | Require user permission before screen sharing starts. |
authorizationPromptTitle | String | Server config | Custom title for the authorization dialog. |
authorizationPromptMessage | String | Server config | Custom message for the authorization dialog. Supports placeholders. |
Message Placeholders
The authorizationPromptMessage supports these placeholders:
{%agentName%|fallback} - Agent's name with a fallback if unavailable{%currentDomain%} - App name on Android
Example:
.authorizationPromptMessage("{%agentName%|Our support team} would like to view your screen")
UI Display
| Option | Type | Default | Description |
|---|
showTerminateButton | Boolean | Server config | Show a button to end the screen sharing session. |
endOfSessionMessage | String | Server config | Message displayed when the session ends. |
stopSessionText | String | Server config | Custom text for the stop session button. |
Remote Control
| Option | Type | Default | Description |
|---|
allowRemoteClick | Boolean | Server config | Allow agents to remotely tap on the screen. |
allowRemoteScroll | Boolean | Server config | Allow agents to remotely scroll the screen. |
requireControlRequest | Boolean | Server config | Require user approval before agents can use remote input. |
controlRequestTitle | String | Server config | Custom title for the control request prompt. |
controlRequestMessage | String | Server config | Custom message for the control request prompt. |
Lookup Code
| Option | Type | Default | Description |
|---|
enableLookupCodeOnShake | Boolean | Server config | Show lookup code dialog when device is shaken. |
lookupCodeKeyTitle | String | Server config | Custom title for the shake detection dialog. |
lookupCodeKeyMessage | String | Server config | Custom message for shake dialog. Supports {%lookupCode%} placeholder. |
Localization Strings
| Option | Type | Description |
|---|
translationsYes | String | Custom text for "Allow" button in authorization prompt. |
translationsNo | String | Custom text for "Deny" button in authorization prompt. |
translationsOk | String | Custom text for "OK" button. |
System Options
| Option | Type | Description |
|---|
autoConnect | Boolean | Automatically connect on initialization. Defaults to true via server config. |
region | String | Server region for connections. |
Custom Authorization UI
You can replace the default authorization dialog with your own UI by providing an onSessionRequest listener:
val config = UpscopeConfiguration.Builder("YOUR_API_KEY")
.requireAuthorizationForSession(true)
.onSessionRequest(OnSessionRequestListener { response, agentName ->
// Show your custom UI here
// Call response.accept() or response.reject()
myCustomDialog.show(agentName) { accepted ->
if (accepted) response.accept() else response.reject()
}
// Return a Cancellable for cleanup if the request is dismissed externally
Cancellable { myCustomDialog.dismiss() }
})
.build()
Similarly, use onControlRequest to customize the remote control authorization prompt:
val config = UpscopeConfiguration.Builder("YOUR_API_KEY")
.requireControlRequest(true)
.onControlRequest(OnControlRequestListener { response ->
response.accept() // or response.reject()
null // or return a Cancellable
})
.build()
Full Example
val config = UpscopeConfiguration.Builder("YOUR_API_KEY")
.requireAuthorizationForSession(true)
.authorizationPromptTitle("Screen Share")
.authorizationPromptMessage("{%agentName%|Support} wants to help you")
.showTerminateButton(true)
.endOfSessionMessage("Session ended. Thank you!")
.stopSessionText("End Session")
.allowRemoteClick(true)
.allowRemoteScroll(true)
.enableLookupCodeOnShake(true)
.lookupCodeKeyTitle("Your Code")
.lookupCodeKeyMessage("Share this code: {%lookupCode%}")
.translationsYes("Yes, share")
.translationsNo("No thanks")
.translationsOk("Got it")
.region("us-east")
.build()
Upscope.initialize(applicationContext, config)