MethodChannelCobrowseIO class

An implementation of CobrowseIO that uses method channels.

https://docs.flutter.dev/packages-and-plugins/developing-packages

Platform messages may fail, so we use a try/catch PlatformException. We also handle the message potentially returning null.

Inheritance

Constructors

MethodChannelCobrowseIO()

Properties

handleRemoteControlRequest Stream<Session>
Listen to this event emitter to override the default remote control acceptance prompt. When you have gained confirmation from the user, you should call Session.setRemoteControl and pass either RemoteControlState.on or RemoteControlState.rejected to approve or reject the remote control request.
no setteroverride
handleSessionRequest Stream<Session>
Listen to this event emitter to override the default session acceptance prompt. The session passed to this method will be in the SessionState.authorizing state, when you have gained confirmation from the user, you should call either Session.activate or Session.end to approve or reject the session.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
hideSessionControls Stream<Session>
Listen to this event emitter to remove the controls you showed in CobrowseIO.showSessionControls.
no setteroverride
implementations Map<String, Future Function(MethodCall)>
getter/setter pair
methodChannel MethodChannel
The method channel used to interact with the native platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionDidEnd Stream<Session>
Called when a session will end.
no setteroverride
sessionDidLoad Stream<Session>
Called when a session is first loaded from the server, either via 6 digit code or connection from an agent.
no setteroverride
sessionDidUpdate Stream<Session>
Called when a new session is started, or an existing session changes state.
no setteroverride
showSessionControls Stream<Session>
Listen to this event emitter to override the default session indicator. This method may be called several times as the session progresses through its lifecycle, so you may need to adjust your UI accordingly. See the available sesssion methods to inspect session state. Note you should also listen to CobrowseIO.hideSessionControls if you are implementing this feature.
no setteroverride

Methods

api() Future<String>
Returns the previously set API endpoint.
override
capabilities() Future<List<String>>
Returns the previously set capabilities, or the default values if no custom capabilities have been set.
override
createSession() Future<Session>
Creates a new screenshare session. Sessions will start in a 'pending' state. To activate a session an agent must have joined and all required consent given by the user. Pending sessions contain a six digit code that can be displayed for the user to give to a support agent.
override
currentSession() Future<Session?>
Gets the current screenshare session. This may be a session waiting to start, the currently active session, or may be null if no session has been created.
override
customData() Future<Map<String, dynamic>>
Returns the previously set custom data.
override
deviceId() Future<String>
Returns the unique device ID generated by the Cobrowse SDK.
override
getSession(String idOrCode) Future<Session>
Fetches a session by its ID or by a 6 digit code. When loaded the callback will be invoked with the session object, or an error if the session could not be fetched.
override
isCobrowseNotification(Map<String, String>? data) Future<bool>
Tests whether a push notification was generated by Cobrowse. Returns true if it looks like a Cobrowse notification.
override
license() Future<String>
Returns the previously set Cobrowse license.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onPushNotification(Map<String, String> data) Future<void>
Call this when your Firebase handler receives a push notification. Non-cobrowse push notifications will be ignored.
override
registration() Future<bool>
Returns a value indicating whether the device should automatically register on the dashboard.
override
setApi(String api) Future<void>
Configure the SDK to use an enterprise deployment API.
override
setCapabilities(List<String> capabilities) Future<void>
Sets the available capabilities for a session. Different annotation tools and events will be available during a session depending on the capabilities you set here. By default all capabilities supported by the device are enabled.
override
setCustomData(Map<String, dynamic> customData) Future<void>
Sets metadata attached to this device that will be displayed and filterable in the web dashboard. This allows you to find and identify your users devices quickly. We recommend adding information such as your logged in users email addresses or user IDs here.
override
setDeviceToken(String token) Future<void>
Sets the device native channel push notification token, i.e. Firebase token. This is only required if you are using our Firebase push support.
override
setLicense(String license) Future<void>
Sets the Cobrowse license (available via the web dashboard).
override
setRegistration(bool registration) Future<void>
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.
override
start() Future<void>
Call start() when you have configured Cobrowse and would like to start accepting incoming session requests. Calling start will register the device into your cobrowse dashboard and open a socket to accept incoming connection requests from your support agents.
override
stop() Future<void>
Stops Cobrowse, de-registering the device from the server and closing any open connections. After this method has been called you can no longer start sessions either via the dashboard, or via a 6 digit code, until Cobrowse has been started again.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited