Documentation

Documentation

YourOwn SetupYourOwn SDKYourOwn API
Sphere SetupSphere SDKSphere API
  • Resources

›Getting started for flutter

Getting started

  • Copilot.cx Mobile SDK
  • Importing the iOS SDK
  • Importing the Android SDK
  • SDK configuration

Getting started for flutter

  • Importing the Copilot.cx Android SDK for Flutter
  • Importing the Copilot.cx iOS SDK for Flutter
  • Interacting with the Copilot.cx SDK in Dart

Getting around

  • Hello Copilot

Reference

  • Application
  • Authentication
  • User
  • Thing
  • In-app messages
  • Report

Event reporting guide

  • Predefined events
  • Custom events

Appendix

  • Releases
  • Open source mapping

Interacting with the Copilot.cx SDK in Dart

Use Copilot.cx SDK through dart code

  1. Inside your project, create a MethodChannel
const channel = MethodChannel('myProjectChannelName');

The Channel name should be the same on all sided (iOS, Android and Flutter).

  1. Add add functions that will invoke the native code through the MethodChannel (iOS and Android)

Future<void> _signup() async {
    try {
        var email = "aa@bbb.com";
        var password = "asdf123";
        var firstName = "Steve";
        var lastName = "Bobson";
        var result = await channel.invokeMethod("signup", {
            "email": email,
            "password": password,
            "firstName": firstName,
            "lastName": lastName
        });
    } on PlatformException catch(e) {
      //Handle error
    }
}

Future<void> _login() async {
    try {
        var email = "aa@bbb.com";
        var password = "asdf123";
        var result = await channel.invokeMethod("login", {
            "email": email,
            "password": password
        });
    } on PlatformException catch(e) {
      //Handle error
    }
}

Future<void> _logout() async {
    try {
        var reasult = await channel.invokeMethod("logout");
    } on PlatformException catch(e) {
      //Handle error
    }   
}

void _sendEvent() {
    var eventName = "eventName";
    var eventParams = {
        "key1": "value1",
        "key2": "value2"
    };
    channel.invokeMethod("sendEvent", {
        "eventName": eventName,
        "eventParams": eventParams}
    );
}
← Importing the Copilot.cx iOS SDK for FlutterHello Copilot →
Copilot
Mail: hello@copilot.cx
Call: (212).398.0001
© Copilot.cx 2025