# Cobrowse - IOS SDK

## Installation

The SaleAssist Cobrowse SDK for iOS is available for installation via several dependency managers, or as frameworks to integrate directly into your project:

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

<pre><code><strong>https://github.com/cobrowseio/cobrowse-sdk-ios-binary.git
</strong></code></pre>

Add the `CobrowseIO` package dependency to **your app targe**
{% endtab %}

{% tab title="Pod" %}

```ruby
pod 'CobrowseIO', '~>2'
```

*Don't forget to run `pod repo update` then `pod install` after you've edited your Podfile.*

*Make sure you are on the latest stable version of Pods. Run `pod --version` to check!*

**Note:** Depending on your project, you may also need `use_frameworks!` in your Podfile.
{% endtab %}

{% tab title="Carthage" %}

```
binary "https://raw.githubusercontent.com/cobrowseio/cobrowse-sdk-ios-binary/master/cobrowse-sdk-ios-binary.json" ~> 2.0
```

{% hint style="info" %}
Remember to run `carthage update` after modifying your Cartfile.
{% endhint %}

*More information about Carthage at* [*https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos*](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos)*.*

Link the `CobrowseIO.framework` to your main app target that can be found at `./Carthage/Build/iOS`.
{% endtab %}

{% tab title="Manual" %}
Frameworks are available for manual integration into your Xcode projects from:

```
https://github.com/cobrowseio/cobrowse-sdk-ios-binary/releases
```

{% endtab %}
{% endtabs %}

Add the following lines to your code which will register this device with the SaleAssist Cobrowse servers so you can connect to it. You could choose to do this on app startup, or when your users visits a support page in your application, or any other time.

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

```javascript
import CobrowseIO
...

CobrowseIO.instance().license = "put your license key here"
CobrowseIO.instance().start()
```

{% endtab %}

{% tab title="Objective-C" %}

```javascript
@import CobrowseIO;
...

CobrowseIO.instance.license = @"put your license key here";
[CobrowseIO.instance start];
```

{% endtab %}
{% endtabs %}

#### Registering on startup

If you would like your devices to register as soon as your app starts, we recommend doing this in your app delegate `application:didFinishLaunchingWithOptions:` method. For example:

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

```javascript
import CobrowseIO

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
{
    CobrowseIO.instance().license = "put your license key here"
    CobrowseIO.instance().start()
    return true
}
```

{% endtab %}

{% tab title="Objective-C" %}

```java
@import CobrowseIO;

- (BOOL)application:(UIApplication*) application didFinishLaunchingWithOptions:(NSDictionary*) launchOptions
{
    CobrowseIO.instance.license = @"put your license key here";
    [CobrowseIO.instance start];
    return YES;
}
```

{% endtab %}
{% endtabs %}

### Identify your devices

[Read here](/integration-guide/mobile-sdk-integration/identify-your-devices-for-cobrowse.md) for Identifying your devices to cobrowse.&#x20;

### Add your License Key

Please register an email at **<support@saleassist.ai>** to get your  License Key.

This will associate sessions from your mobile app with your  SaleAssist Cobrowse account.

## Requirements

* iOS 11.0 or later


---

# 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/cobrowse-ios-sdk.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.
