Starting and stopping the SDK
Have greater control over when the SDK is running.
Starting the Cobrowse SDK is often done early in your application. However, you have the ability to delay the start of the SDK or programmatically stop the SDK so that it runs only when needed.
Web
iOS
Android
React Native
Xamarin
Windows
await CobrowseIO.client();
await CobrowseIO.start();
Sometimes it is required to run Cobrowse.io only within an IFrame, and not any containing or parent page. This is supported, but requires passing an extra configuration option when starting Cobrowse. Most implementations should not need to use this. Please contact us if you are unsure.
await CobrowseIO.start({ allowIFrameStart: true });
Swift
CobrowseIO.instance().start()
Objective-C
[CobrowseIO.instance start];
CobrowseIO.instance().start(this);
CobrowseIO.start();
CobrowseIO.Instance.Start();
await CobrowseIO.Instance.Start();
By default, when the SDK starts it will register the device to your account and share its connectivity state. This provides the dashboard with a list of devices which are online and ready to connect.
If you don't need to see a list of devices in your dashboard, e.g. your sessions start only using 6-digit codes, then you can stop the SDK from registering the device and its connectivity status by setting the registration option with a value of
false
.Web
iOS
Android
Windows
CobrowseIO.registration = false;
CobrowseIO.instance.registration = NO;
CobrowseIO.instance().registration(false);
CobrowseIO.Instance.Registration = false;
Calling
stop()
will stop Cobrowse completely and you won't be able to Cobrowse again until you call start()
. If you only wish to end a session please use end()
method on the Session
object.Web
iOS
Android
React Native
Xamarin
Windows
await CobrowseIO.stop();
Swift
CobrowseIO.instance().stop()
Objective-C
[CobrowseIO.instance stop];
CobrowseIO.instance().stop();
CobrowseIO.stop();
CobrowseIO.Instance.Stop();
CobrowseIO.Instance.Stop();
Last modified 1mo ago