SaleAssist for Developers
HomeDashboardAPI DocsBook A Demo
  • 👋Welcome
  • Introduction
  • Onboarding Steps
  • Admin Account Creation
  • Getting Started
  • Features Overview
    • Live Video Calling
      • Outbound Calls
        • Schedule Video Meets
        • Instant Video Meets
      • Inbound Calls
        • How to use ?
        • Integration
        • Desktop Call Management
    • Live Stream Selling
      • How to go Live?
      • Get RTMP and Stream Key from social channels.
    • Shoppable Videos Tiles
      • How to use?
      • Integration
    • Strike
      • AI Videos
    • Co-Browsing
  • Integration Guide
    • Mobile SDK integration
      • Cobrowse - Flutter SDK
      • React Native SDK
      • IOS SDK
      • Android SDK
      • How to delete my account?
      • Cobrowse - Android SDK
      • Cobrowse - IOS SDK
      • Identify your devices for Cobrowse
      • Use 6-digit codes
      • Redact sensitive data
      • Start and Stop Cobrowsing
      • Listening for events
    • User Experience
    • Agent Mapping
    • Nudges
    • Agent Feedback
    • AI Chat (Add Context)
    • API Integration
    • Webhook Integration
    • FAQ & Troubleshooting
    • Lead Management
    • Task Management
    • SaleAssist Whatsapp Feature
    • Sales/Conversion Tracking - Widget
    • Sales/Conversion Tracking - Video Tiles
    • Integrate meetings lite dashboard
  • Assets Managment
    • Media
    • Products
    • Orders
  • Organization Settings
    • Profile
    • Organization
    • Users & Roles
    • SMTP Integration
    • Custom Domain
    • Notification Manager
  • Addons
    • Transcription & Summarization
    • Video QR Codes
    • Video Emails
    • Live Chat
    • Outbound Phone Calling
    • Book In-store appointment
    • Schedule Call
    • Shoppable Video Links
      • How to use?
      • Integration
    • Video FAQs
      • How to use?
      • Integration
    • WhatsApp Onboarding steps
  • Analytics
    • Widget Insights
    • Video tiles insights
    • Reporting
    • SaleAssist Mobile Application
    • How to manage calls on Mobile Application
    • Admin Controls
  • Troubleshooting
    • Troubleshoot Video Call Permissions
  • Release Logs
    • v24.11.24
    • v24.11.30
    • v24.12.10
    • v25.01.10
    • v25.01.18
    • v25.01.29
    • v25.02.05
    • v25.02.05
Powered by GitBook
On this page

Was this helpful?

  1. Integration Guide
  2. Mobile SDK integration

Use 6-digit codes

Cobrowse does not require any visible UI presented to the user but there is the option to present a UI that generates a 6-digit code. Learn more.

PreviousIdentify your devices for CobrowseNextRedact sensitive data

Last updated 8 months ago

Was this helpful?

By default, Cobrowse does not require any visible UI presented to the user. It will exist in the background of your app, and only activate when agents initiate a new session.

You may optionally present a UI in your app that enables users to generate 6-digit codes. Users may then read a code over the phone or in chat, and agents can use the 6-digit code to initiate the Cobrowse session.

Important: 6-digit codes expire after approximately 20 minutes, so it's best practice to generate a code only when a user wants to start a session.

To generate a 6-digit code in your integration you can use the following APIs. Once you have generated the code you can display it to the user in your own UI. You should only generate a code when a user needs it as they expire shortly after creation.

// ensure Cobrowse is loaded
CobrowseIO.client().then(function() {
    // create a code a display it to the user using your own UI
    // ONLY GENERATE CODE WHEN NEEDED. DO NOT GENERATE CODE ON PAGE LOAD.
    CobrowseIO.createSessionCode().then(function(code) {
       console.log('your code is', code);
    });
});
[CobrowseIO.instance createSession:^(NSError * err, CBIOSession * session) {
    if (err) NSLog(@"Failed to create code")
    else NSLog(@"%@", session.code);
}];

Objective-C

CobrowseIO.instance.customData = @{
    kCBIOUserIdKey: @"<your_user_id>",
    kCBIOUserNameKey: @"<your_user_name>",
    kCBIOUserEmailKey: @"<your_user_email>",
    kCBIODeviceIdKey: @"<your_device_id>",
    kCBIODeviceNameKey: @"<your_device_name>"
};
CobrowseIO.instance().createSession((err, session) -> {
    if (err != null) Log.w("App", "Failed to create code");
    else if (session != null) Log.i("App", "Session code " + session.code());
});
CobrowseIO.instance().createSession((err, session) -> {
    if (err != null) Log.w("App", "Failed to create code");
    else if (session != null) Log.i("App", "Session code " + session.code());
});Session session = await CobrowseIO.instance.createSession();
Session session = await CobrowseIO.instance.createSession();
log('Your session code: ${session.code}');
CobrowseIO.Instance.CreateSession((Exception err, ISession session) => {
    if (err != null) Debug.WriteLine("Failed to create a code");
    else if (session != null) Debug.WriteLine("Session code " + session.Code);
});
Session session = await CobrowseIO.Instance.CreateSession();
Console.WriteLine("Code: {0}", session.Code);

If you are only using 6 digit codes to start Cobrowse sessions in your implementation, you can prevent the SDK registering in your Cobrowse account until a screen sharing session is required. See the documentation on preventing automatic registration.

Default 6-digit code UI

We provide a very simple default plug-and-play UI that provides the 6-digit code display functionality. We also provide a set of public methods if you prefer to build a custom UI (see above). Learn more at

Web

The Cobrowse.io SDK for web does not provide a default UI for generating 6 digit codes.

iOS

  1. Add the appropriate code below into a view controller in your app.

  2. Hook up a trigger for the action (or call it programatically if you prefer).

Swift

import CobrowseIO

class ExampleViewController: UIViewController {
    var sessionController: CBIOViewController!

    @IBAction func startCobrowse(sender: UIBarButtonItem) {
        self.sessionController = CBIOViewController()
        self.navigationController?.pushViewController(self.sessionController, animated: true)
    }

    // ... the rest of your view controller
}

Objective C

Copy

@import CobrowseIO;

@implementation ExampleViewController {
    CBIOViewController* sessionController;
}

-(IBAction) startCobrowse:(id)sender {
    sessionController = [[CBIOViewController alloc] init];
    [self.navigationController pushViewController:sessionController animated:YES];
}

// ... the rest of your view controller

@end
Android
import io.cobrowse.ui.CobrowseActivity;

public class YourActivity extends Activity {

    // the rest of your Activity

    public void startCobrowse(View view) {
        Intent intent = new Intent(this, CobrowseActivity.class);
        startActivity(intent);
    }
}

React Native

We've provided a view that will do all the session creation and management for you. All you need to do is include this somewhere in your react native view hierarchy. It's not a requirement to use this UI, you can easily build your own if you like!

Copy

import { CobrowseView } from 'cobrowse-sdk-react-native';

export default class App extends Component {
    render() {
        return (
            <View>
                <CobrowseView />
            </View>
        );
    }
}

Flutter

iOS implementation

Copy

@import CobrowseIO;

UIViewController *rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
CBIOViewController *sessionController = [[CBIOViewController alloc] init];
[rootViewController presentViewController:sessionController animated:YES completion:nil];

Android implementation

Copy

import io.cobrowse.ui.CobrowseActivity;

Intent intent = new Intent(activity, CobrowseActivity.class);
activity.startActivity(intent);

Xamarin.iOS implementation

  1. Add the appropriate code below into a view controller in your app.

  2. Hook up a trigger for the action (or call it programatically if you prefer).

Copy

using Xamarin.CobrowseIO;

namespace SampleApp.iOS
{
    public partial class ViewController : UIViewController
    {
        private void StartCobrowse(object sender, EventArgs e)
        {
            NavigationController.PushViewController(new CobrowseViewController(), animated: true);
        }
    }
}

Xamarin.Android implementation

We have provided some default UI to make things easier to get started:

Copy

using Xamarin.CobrowseIO;
using Xamarin.CobrowseIO.UI;

namespace SampleApp.Android
{
    [Activity]
    public class MainActivity : AppCompatActivity
    {
        private void StartCobrowse(object sender, EventArgs e)
        {
            var intent = new Intent(this, typeof(CobrowseActivity));
            StartActivity(intent);
        }
    }
}

Xamarin.Forms implementation

The Cobrowse.io Xamarin SDK provides a convenient way to open the default 6 digit code UI. In your cross-platform project:

Copy

using Xamarin.CobrowseIO.Abstractions;

namespace YourAppNamespace.Forms
{
    public partial class YourPage : Xamarin.Forms.Page
    {
        public void StartCobrowse()
        {
            CobrowseIO.Instance.OpenCobrowseUI();
        }
    }
}

.NET Mobile implementation

Copy

using Cobrowse.IO;

public partial class MainPage : Microsoft.Maui.Controls.ContentPage
{
    public void StartCobrowse()
    {
        CobrowseIO.Instance.OpenCobrowseUI();
    }
}

MacOS

The Cobrowse.io SDK for MacOS does not provide a default UI for generating 6 digit codes.

Windows

The Cobrowse.io SDK for Windows does not provide a default UI for generating 6 digit codes, instead you can generate a code for your UI by using the CreateSession API.

For a full example written in Swift, see our Listr sample app at:

The Cobrowse.io SDK for Flutter does not provide a default UI for generating 6 digit codes, but you can show the default UI shipped in the native SDKs using . It's not a requirement to use this UI, you can easily build your own if you like!

For a full example written in C#, see our sample app at:

Start and Stopping Cobrowsing
Customize the interface.
https://github.com/cobrowseio/Listr
Flutter platform channel
https://github.com/cobrowseio/cobrowse-sdk-xamarin