Configuration Options
You can customize the behavior of the Co-Browsing API iOS SDK through configuration options.
Setting Configuration
Pass options when creating the UpscopeConfiguration:
let config = UpscopeConfiguration(
apiKey: "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"
)
try Upscope.shared.initialize(with: config)
Configuration Options
Message Placeholders
The authorizationPromptMessage supports these placeholders:
{%agentName%|fallback}- Agent's name with a fallback if unavailable{%currentDomain%}- App name on iOS
Example:
authorizationPromptMessage: "{%agentName%|Our support team} would like to view your screen"
UI Display
| Option | Type | Default | Description |
|---|---|---|---|
showTerminateButton | Bool? | (Set through the admin interface) | Show a button to end the screen sharing session. |
endOfSessionMessage | String? | (Set through the admin interface) | Message displayed when the session ends. |
stopSessionText | String? | (Set through the admin interface) | Custom text for the stop session button. |
Remote Control
| Option | Type | Default | Description |
|---|---|---|---|
allowRemoteClick | Bool? | (Set through the admin interface) | Allow agents to remotely tap on the screen. |
allowRemoteScroll | Bool? | (Set through the admin interface) | Allow agents to remotely scroll the screen. |
requireControlRequest | Bool? | (Set through the admin interface) | Require user approval before agents can use remote input. |
controlRequestTitle | String? | (Set through the admin interface) | Custom title for the control request prompt. |
controlRequestMessage | String? | (Set through the admin interface) | Custom message for the control request prompt. |
Lookup Code
| Option | Type | Default | Description |
|---|---|---|---|
enableLookupCodeOnShake | Bool? | (Set through the admin interface) | Show lookup code popup when device is shaken. |
lookupCodeKeyTitle | String? | (Set through the admin interface) | Custom title for the shake detection alert. |
lookupCodeKeyMessage | String? | (Set through the admin interface) | Custom message for shake alert. 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. |
Multi-Language Translations
Every text option (titles, messages, and the strings above) also accepts a dictionary keyed by language code instead of a single string. The translation matching the device language is shown, falling back to en if the device language isn't included:
translationsYes: ["en": "Yes", "it": "Si"],
translationsNo: ["en": "No", "it": "No"]
All of these can also be configured per language through the dashboard.
Full Device Screen Sharing
| Option | Type | Description |
|---|---|---|
broadcastAppGroupId | String? | App Group identifier shared between your app and the Broadcast Upload Extension. Required for full-device screen sharing. See Full Device Screen Sharing. |
broadcastExtensionBundleId | String? | Bundle identifier of your Broadcast Upload Extension, used to auto-select it in the system broadcast picker. |
disableFullScreenWhenMasked | Bool? | When true, full device screen sharing is automatically declined if any masked views are present. Default: (Set through the admin interface). |
onFullDeviceRequest | ((SessionRequestResponse) -> Cancellable?)? | Called when an agent requests full-device sharing, before the system broadcast picker appears. Show your own UI, then call response.accept() to continue to the picker or response.reject() to decline. When unset, the SDK proceeds to the picker directly. |
See Full Device Screen Sharing for the full setup guide.
System Options
| Option | Type | Description |
|---|---|---|
autoconnect | Bool? | Automatically connect on initialization. Default: true (set through the admin interface). |
region | String? | Server region for connections. |
Full Example
let config = UpscopeConfiguration(
apiKey: "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",
broadcastAppGroupId: "group.com.yourcompany.yourapp",
broadcastExtensionBundleId: "com.yourcompany.yourapp.broadcast"
)
try Upscope.shared.initialize(with: config)