# Start and Stop Cobrowsing

Starting the SaleAssist 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.

#### Starting the SDK <a href="#starting-the-sdk" id="starting-the-sdk"></a>

{% tabs %}
{% tab title="Web" %}

```
await CobrowseIO.client();
await CobrowseIO.start();
```

{% endtab %}

{% tab title="iOS" %}
**Swift**

```java
CobrowseIO.instance().start()
```

**Objective-C**

```java
[CobrowseIO.instance start];
```

{% endtab %}

{% tab title="Android" %}

{% endtab %}

{% tab title="React Native" %}

{% endtab %}

{% tab title="Flutter" %}

```xml
await CobrowseIO.client();
await CobrowseIO.start();
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If you do decide to delay or lazy load the SDK it is important to check if there is a currently active session and if so load and start the SDK right away. Without this check sessions would not continue between navigation or page refreshes as the SDK won't be loaded.

// On page load check if we should start the Cobrowse SDK right away&#x20;

if (CobrowseIO.currrentSession) {&#x20;

await CobrowseIO.client();&#x20;

await CobrowseIO.start();&#x20;

}
{% endhint %}

#### Automatic registration <a href="#automatic-registration" id="automatic-registration"></a>

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`.

{% tabs %}
{% tab title="Web" %}

```java
CobrowseIO.registration = false;
```

{% endtab %}

{% tab title="iOS" %}
CobrowseIO.instance.registration = NO;
{% endtab %}

{% tab title="Android" %}

```
CobrowseIO.instance().registration(false);
```

{% endtab %}

{% tab title="Flutter" %}
CobrowseIO.instance.setRegistration(false);
{% endtab %}
{% endtabs %}

#### Stopping the SDK <a href="#stopping-the-sdk" id="stopping-the-sdk"></a>

Calling `stop()` will stop Cobrowsing 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.

{% tabs %}
{% tab title="Web" %}
await CobrowseIO.stop();
{% endtab %}

{% tab title="iOS" %}
**Swift**

```java
CobrowseIO.instance().stop()
```

**Objective-C**

```
[CobrowseIO.instance stop];
```

{% endtab %}

{% tab title="Android" %}
CobrowseIO.instance().stop();
{% endtab %}

{% tab title="Flutter" %}
CobrowseIO.instance.stop();
{% endtab %}

{% tab title="React Native" %}
CobrowseIO.stop();
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.saleassist.ai/integration-guide/mobile-sdk-integration/start-and-stop-cobrowsing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
