Documentation

    Configuration Options

    You can customize the behavior of the Co-Browsing API iOS SDK through local configuration options.

    Setting Configuration

    Pass a PartialConfiguration when initializing the SDK:

    let localConfig = PartialConfiguration(
        settings: PartialConfiguration.Settings(
            requireAuthorizationForSession: true,
            authorizationPromptTitle: "Screen Sharing Request",
            authorizationPromptMessage: "Allow {%agentName%|Support} to view your screen?",
            endOfScreenshareMessage: "Thanks for using screen sharing!",
            translationsYes: "Allow",
            translationsNo: "Decline"
        )
    )
    
    let upscopeManager = UpscopeManager(
        apiKey: "YOUR_API_KEY",
        localConfig: localConfig
    )
    

    Configuration Options

    Session Authorization

    OptionTypeDefaultDescription
    requireAuthorizationForSessionBooltrueRequire user permission before screen sharing starts.
    authorizationPromptTitleStringCustom title for the authorization dialog.
    authorizationPromptMessageStringCustom 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
    showTerminateButtonBoolfalseShow a button to end the screen sharing session.
    showUpscopeLinkBoolfalseShow Upscope branding link.
    endOfScreenshareMessageStringMessage displayed when the session ends.

    Lookup Code

    OptionTypeDefaultDescription
    enableLookupCodeOnShakeBooltrueShow lookup code popup when device is shaken.
    lookupCodeKeyTitleStringCustom title for the shake detection alert.
    lookupCodeKeyMessageStringCustom message for shake alert. Supports {%lookupCode%} placeholder.

    Localization Strings

    OptionTypeDescription
    translationsYesStringCustom text for "Allow" button in authorization prompt.
    translationsNoStringCustom text for "Deny" button in authorization prompt.
    translationsOkStringCustom text for "OK" button.
    translationsStopSessionStringCustom text for stop session button.

    System Options

    OptionTypeDescription
    autoconnectBoolAutomatically connect on initialization.
    betaBoolEnable beta features.
    teamDomainStringCustom team domain.
    defaultRegionStringDefault region for connections.

    Full Example

    let config = PartialConfiguration(
        settings: PartialConfiguration.Settings(
            requireAuthorizationForSession: true,
            authorizationPromptTitle: "Screen Share",
            authorizationPromptMessage: "{%agentName%|Support} wants to help you",
            showTerminateButton: true,
            endOfScreenshareMessage: "Session ended. Thank you!",
            enableLookupCodeOnShake: true,
            lookupCodeKeyTitle: "Your Code",
            lookupCodeKeyMessage: "Share this code: {%lookupCode%}",
            translationsYes: "Yes, share",
            translationsNo: "No thanks",
            translationsOk: "Got it",
            translationsStopSession: "End Session"
        ),
        defaultRegion: "United States"
    )
    
    let manager = UpscopeManager(apiKey: "YOUR_API_KEY", localConfig: config)