Documentation

Configuration Options

You can customize the behavior of the UserView 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

Session Authorization

OptionTypeDefaultDescription
requireAuthorizationForSessionBool?nil (server config)Require user permission before screen sharing starts.
authorizationPromptTitleString?nil (server config)Custom title for the authorization dialog.
authorizationPromptMessageString?nil (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 iOS

Example:

authorizationPromptMessage: "{%agentName%|Our support team} would like to view your screen"

UI Display

OptionTypeDefaultDescription
showTerminateButtonBool?nil (server config)Show a button to end the screen sharing session.
endOfSessionMessageString?nil (server config)Message displayed when the session ends.
stopSessionTextString?nil (server config)Custom text for the stop session button.

Remote Control

OptionTypeDefaultDescription
allowRemoteClickBool?nil (server config)Allow agents to remotely tap on the screen.
allowRemoteScrollBool?nil (server config)Allow agents to remotely scroll the screen.
requireControlRequestBool?nil (server config)Require user approval before agents can use remote input.
controlRequestTitleString?nil (server config)Custom title for the control request prompt.
controlRequestMessageString?nil (server config)Custom message for the control request prompt.

Lookup Code

OptionTypeDefaultDescription
enableLookupCodeOnShakeBool?nil (server config)Show lookup code popup when device is shaken.
lookupCodeKeyTitleString?nil (server config)Custom title for the shake detection alert.
lookupCodeKeyMessageString?nil (server config)Custom message for shake alert. Supports {%lookupCode%} placeholder.

Localization Strings

OptionTypeDescription
translationsYesString?Custom text for "Allow" button in authorization prompt.
translationsNoString?Custom text for "Deny" button in authorization prompt.
translationsOkString?Custom text for "OK" button.

Full Device Screen Sharing

OptionTypeDescription
broadcastAppGroupIdString?App Group identifier shared between your app and the Broadcast Extension. Required for full device screen sharing.
broadcastExtensionBundleIdString?Bundle identifier of your Broadcast Upload Extension. Used to auto-select it in the system broadcast picker.

See here for the full setup guide.

System Options

OptionTypeDescription
autoconnectBool?Automatically connect on initialization. Defaults to true via server config.
regionString?Server region for connections.

Custom Authorization UI

You can replace the default authorization dialog with your own UI by setting the onSessionRequest property after creating the configuration:

var config = UpscopeConfiguration(
    apiKey: "YOUR_API_KEY",
    requireAuthorizationForSession: true
)

config.onSessionRequest = { response, agentName in
    // Show your custom UI here
    // Call response.accept() or response.reject()
    myCustomAlert.show(agentName: agentName) { accepted in
        if accepted {
            response.accept()
        } else {
            response.reject()
        }
    }
    // Return a Cancellable for cleanup if the request is dismissed externally
    return Cancellable {
        myCustomAlert.dismiss()
    }
}

try Upscope.shared.initialize(with: config)

Similarly, use onControlRequest to customize the remote control authorization prompt:

var config = UpscopeConfiguration(
    apiKey: "YOUR_API_KEY",
    requireControlRequest: true
)

config.onControlRequest = { response in
    // Show your custom UI
    response.accept() // or response.reject()
    return nil // or return a Cancellable
}

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)