• Release Notes
  • User
  • Admin
  • Developers
  • Integrations

›Xamarin

General

  • Overview
  • LiveView / CoBrowsing / Session Recordings

JS API

  • Overview
  • CoBrowsing
  • LiveView / Session Recordings
  • WebChat
  • Web Calling
  • Video Conference
  • Logging
  • User
  • Team
  • API
  • Supported Browsers
  • Supported Technologies

Android

  • Overview
  • Installation
  • Usage
  • Reference
  • Licenses

iOS

  • Overview
  • Installation
  • Usage
  • Reference
  • Licenses

React Native

  • Overview
  • Installation
  • Usage
  • Reference

Cordova

  • Overview
  • Installation
  • Usage

Xamarin

  • Overview
  • Installation
  • Usage
  • Reference

Flutter

  • Overview
  • Installation
  • Usage
  • Reference

Capacitor

  • Overview
  • Installation
  • Usage
  • Reference

Usage

The Xamarin SDK largely follows the native implementations for Android and iOS. However, names of classes and interfaces are adapted to C# conventions. Also a few differences need to be considered.

Xamarin specific topics

Interface

The SDK is available by using the method of the interface IChatvisor. An instance for the platform the code is running on (Android or iOS) can be obtained by calling Chatvisor.Instance.

using Xamarin.LiveView;
using Xamarin.LiveView.Abstractions;

...

IChatvisor instance = Chatvisor.Instance;
instance.Init("your-tenant-id", "your-token");

User tagging

For user tagging instances of the class ActiveUser are used (see the Android documentation for an example). Because of restrictions of the Xamarin environment, the constructor cannot be called directly. As a solution Chatvisor.Instance.CreateUser() can be used which yields a new empty instance of the ActiveUser class (implementing the interface IActiveUser) for the current platform.

IActiveUser user = instance.CreateUser()
    .WithEmail("john.doe@example.org")
Chatvisor.Instance.User.Tag(user);

Example

namespace TestApp
{
    public partial class MainPage : ContentPage
    {
        private IChatvisor instance;
        
        public MainPage()
        {
            InitializeComponent();

            instance = Chatvisor.Instance;
            instance.Init("user", "...");
        }

        void CoBrowsingStartClicked(System.Object sender, System.EventArgs e)
        {
            instance.CoBrowsing.Start();
        }
    }
}

← InstallationReference →
  • Xamarin specific topics
    • Interface
    • User tagging
  • Example
MANUALS
User Manual: Sales Suite
Admin Manual: Sales Suite
User Manual: Support Suite
Admin Manual: Support Suite
DEVELOPERS
Integrations
REST API
SDK API
LEGAL
Privacy Policy
Terms and Conditions
Imprint
Engage
Copyright © 2023 Chatvisor GmbH