Cobrowse.io Docs
  • Getting started
  • SDK Installation
    • Web
    • iOS
    • Android
    • React Native
    • Flutter
    • .NET Mobile
    • macOS
    • Windows
  • SDK Features
    • Account config
    • Identify your devices
    • Use 6-digit codes
    • Redact sensitive data
    • Viewing PDFs
    • Universal Cobrowse
    • Customize the interface
      • Active session controls
      • 6-digit code screen
      • User consent dialog
      • Remote control consent dialog
      • Full device consent dialog
      • Localization / translation
    • Initiate sessions with push
    • Listening for events
    • Full device capabilities
      • Full device screen sharing
      • Full device remote control
      • Managing full device mode
    • Advanced configuration
      • Starting and stopping the SDK
      • Declaring capabilities
      • Intercepting mobile SDK network requests
      • Web
        • IFrames support
        • IE 11 polyfills
        • Cross-domain session support
        • Ignore Views
      • iOS
        • Alternate render method
        • Custom touch handling
      • Android
        • Backporting TLS to older Android versions
  • Agent-side integrations
    • Agent-side overview
    • Platform integrations
      • Zendesk
      • Salesforce
        • Migrating from legacy to v2
        • Salesforce (Legacy)
      • Genesys
        • Genesys Cloud
        • Engage Workspace Web Edition (WWE)
        • Engage Workspace Desktop Edition (WDE)
      • Intercom
      • Freshworks
      • Talkdesk
      • NICE
    • Custom integrations
    • Agent SDK
      • API Reference
      • Sample code snippets
    • Authentication (JWTs)
      • JWT Policies
    • Authentication (SAML 2.0)
    • IFrame embeds
  • Enterprise self-hosting
    • Self-hosting overview
    • Docker Compose
    • Helm chart
      • Image Pull Secret
      • Environment Variables
      • Optional recording components
      • Pod Annotations
    • AWS terraform
      • AWS metrics configuration
    • Azure terraform
      • Azure metrics configuration
    • GCP terraform
      • GCP metrics configuration
    • Sizing guidelines
    • Running your instance
      • Adding a superuser
      • Limiting account creation
      • Limiting magic link recipients
      • Configuring SMTP
      • Managing your deployment
    • Monitoring your instance
      • Available metrics
      • Self-Hosted Prometheus
    • Advanced configuration
      • Air gap configuration
      • Pin web SDK version
      • L7 firewall configuration
      • Docker proxy configuration
    • Troubleshooting
Powered by GitBook
On this page
  • Managing full device state from the SDKs
  • Controlling full device state from the Agent SDK

Was this helpful?

  1. SDK Features
  2. Full device capabilities

Managing full device mode

Learn how to promote a session to full device mode using the SDK, as per your requirements.

PreviousFull device remote controlNextAdvanced configuration

Last updated 3 months ago

Was this helpful?

Managing full device state from the SDKs

In some situations it is useful to be able to switch a Cobrowse session into full device mode using the SDK. For example, if you would like sessions to default to full device mode, or enforce full device mode is always (or never) used. We provide an API for doing this:

await session.setFullDevice('requested')

Swift

session.setFullDevice(.requested)

Objective-C

[session setFullDevice: CBIOFullDeviceStateRequested callback:nil];
session.setFullDevice(Session.FullDeviceState.Requested, (err, arg) -> {
    // handle error
});
await session.setFullDevice(true)
Session? session = await CobrowseIO.instance.currentSession();
if (session != null) {
    try {
        await session.setFullDevice(FullDeviceState.on);
    } on PlatformException catch (e) {
        // E.g. a network error
        log('Cannot update the full device state: ${e.message}');
    }
}
Session session = CobrowseIO.Instance.CurrentSession;
if (session != null)
{
    session.SetFullDeviceState(FullDeviceState.On, (err, session) =>
    {
        if (err != null)
        {
            // E.g. a network error
        }
        else
        {
            // Full device mode is activated
        }
    });
}

See this in action: .

These APIs can be used in combination with our various to switch the session in and out of full device mode as your use case requires.

For example, to request full device is used by default, you can set the full device state when the session is first loaded by the SDK:

CobrowseIO.on('session.loaded', session => session.setFullDevice('requested')) 

Swift

// You must have implmented the CobrowseIODelegate
func cobrowseSessionDidLoad(_ session: CBIOSession) {
    session.setFullDevice(.requested)
}

Objective-C

// You must have implmented the CobrowseIODelegate
- (void)cobrowseSessionDidLoad:(CBIOSession *)session {
    [session setFullDevice: CBIOFullDeviceStateRequested callback:nil];
}
// note: you must have implmented CobrowseIO.SessionLoadDelegate
@Override
public void sessionDidLoad(@NonNull Session session) {
    session.setFullDevice(Session.FullDeviceState.Requested, null);
}
CobrowseIO.addListener('session.loaded', session => {
    console.log('A session was loaded', session)
    await session.setFullDevice(true)
})
CobrowseIO.instance.sessionDidLoad.listen((session) {
    try {
        await session.setFullDevice(FullDeviceState.on);
    } on PlatformException catch (e) {
        // E.g. a network error
        log('Cannot update the full device state: ${e.message}');
    }
});
CobrowseIO.Instance.SessionDidLoad += (sender, session) =>
{
    session.SetFullDeviceState(FullDeviceState.On, (err, session) =>
    {
        if (err != null)
        {
            // E.g. a network error
        }
        else
        {
            // Full device mode is activated
        }
    });
};

Controlling full device state from the Agent SDK

You may also set the full device state using the Agent SDK. See the Agent SDK for more details.

https://github.com/cobrowseio/cobrowse-sdk-js-examples#full-device-mode-by-default
delegate APIs
API Reference