@@ -26,6 +26,8 @@ A bird's eye overview/usage of the plugin:
2626
2727### Call State flow
2828
29+ The following describes the standard call flow expected of the ` CallState ` enum.
30+
2931![ ] ( https://raw.githubusercontent.com/cybex-dev/web_callkit/refs/heads/master/doc/images/callflow.png )
3032
3133## Limitations
@@ -34,12 +36,13 @@ A bird's eye overview/usage of the plugin:
3436
3537Use native browser integration, the following limitations apply to each platform. Usage of Flutter
3638package [ js_notifications] ( https://pub.dev/packages/js_notifications ) is assist in browser
37- notification integration to native systems. See [ js_notifications > platform limitations] ( https://github.com/cybex-dev/js_notifications?tab=readme-ov-file#platform-limitations )
39+ notification integration to native systems.
40+ See [ js_notifications > platform limitations] ( https://github.com/cybex-dev/js_notifications?tab=readme-ov-file#platform-limitations )
3841for more information
3942
4043## Installation
4144
42- ### Import the package
45+ ### Import the package
4346
4447``` dart
4548import 'package:web_callkit/web_callkit.dart';
@@ -51,10 +54,7 @@ Inform the plugin that an incoming call is being received. This will hook into t
5154notification system.
5255
5356``` dart
54- WebCallKit.instance.displayIncomingCall(
55- uuid: '1234',
56- handle: 'John Doe',
57- );
57+ WebCallKit.instance.displayIncomingCall(uuid: '1234',handle: 'John Doe',);
5858```
5959
6060### End the call
@@ -83,32 +83,94 @@ e.g. `WebCallKit.instance.reportCallDisconnected('1234', response: DisconnectRes
8383#### Call Management
8484
8585CallKit provides a simple API to manage calls. The plugin provides methods to report incoming calls,
86- end calls, and update call information. Futher, inspiration is taken from Android's ConnectionService
87- providing a set of capabilities to manage calls, such as:
88-
89- | Reason | Description |
90- | --------------| -------------------------------------------------------------|
91- | hold | Ability to place a call on hold after the call has started. |
92- | supportHold | Ability to place a call on hold from the start of the call. |
93- | mute | Ability to mute a call. |
86+ end calls, and update call information. Futher, inspiration is taken from Android's
87+ ConnectionService providing a set of capabilities to manage calls:
9488
9589##### Incoming Calls
9690
9791Incoming calls are displayed on the screen with the caller's name and number. The call screen can be
9892customized with the caller's name, number, and profile picture.
9993
10094``` dart
101- WebCallKit.instance.reportNewCall(
102- uuid: '1234',
103- handle: 'John Doe',
104- );
95+ WebCallKit.instance.reportNewCall(uuid: '1234', handle: 'John Doe',);
96+ ```
97+
98+ ##### End Calls
99+
100+ End calls by calling the ` endCall ` method. This will remove the call screen and stop the browser
101+ notification.
102+
103+ ``` dart
104+ WebCallKit.instance.reportCallDisconnected('1234', response:DisconnectResponse.local);
105105```
106106
107+ The response parameter is an enum of ` DisconnectResponse ` which specifies the reason for the call
108+ disconnection. Due to the CallKit's nature, the call can be disconnected for various reasons,
109+ such as local user requests, remote errors, or disconnects with VoIP calls due to internet
110+ disruptions.
111+ ` DisconnectReseponse ` s are limited call states, for example an Call with an ` initiated ` state
112+ cannot be ended with a decline.
113+
114+ The following described scenarios are valid DisconnectResponses for specific call states:
115+
116+ | ` CallState ` | ` DisconnectResponse ` |
117+ | ---------------| ----------------------------------------------------------|
118+ | initiated | local, remote, canceled, rejected, busy, unknown, error, |
119+ | ringing | remote, missed, rejected, busy, unknown, error, |
120+ | dialing | local, rejected, busy, unknown, error, |
121+ | active | local, remote, unknown, error, |
122+ | reconnecting | local, remote, unknown, error, |
123+ | disconnecting | local, remote, unknown, error, |
124+ | disconnected | local, remote, unknown, error, |
125+
107126#### Notification Integration
108127
128+ t.b.c.
129+
109130#### Capabilities
110131
111- ## Limitations / Future work
132+ CallKit provides a set of capabilities to manage calls. These capabilities provide the ability for
133+ features to be limited based on developer/user requirements.
134+
135+ The following describes the capabilities available:
136+
137+ | Reason | Description |
138+ | -------------| -------------------------------------------------------------|
139+ | hold | Ability to place a call on hold after the call has started. |
140+ | supportHold | Ability to place a call on hold from the start of the call. |
141+ | mute | Ability to mute a call. |
142+ | video | Ability to stream/support video or screenshare streaming. |
143+ | silence | Ability to silence an incoming call. |
144+
145+ The following provides an example of how to report call capabilities:
146+
147+ ``` dart
148+ WebCallKit.instance.reportCallCapabilities('1234', capabilities: [CallCapability.hold, CallCapability.mute]);
149+ ```
112150
113- - Support video & desktop streaming natively
151+ #### Call Actions
152+
153+ CallKit provides a set of actions to manage calls. These actions provide the ability for features to
154+ manage calls from the notification tray.
155+
156+ The following describes the actions available:
157+
158+ | Action | Description |
159+ | -------------------| -------------------------------------------------------------------------------------------------------------------------|
160+ | none | No action |
161+ | answer | Answer & accept call intent. |
162+ | decline | Declining call intent. |
163+ | hangUp | Ending a call regardless of state. |
164+ | dismiss | Dismiss a notification. |
165+ | callback | Callback intent. |
166+ | switchVideo | Switching to video call intent subject to [ CallKitCapability.switchVideo] capability. |
167+ | switchAudio | Switching to audio call intent, opposite of [ switchVideo] and [ switchScreenShare] . |
168+ | switchScreenShare | Switching to screen-share call intent, adjacent to [ switchVideo] subject to [ CallKitCapability.screenShare] capability. |
169+ | mute | Muting a call intent subject to [ CallKitCapability.mute] capability. |
170+ | unmute | Unmuting a call intent, opposite of [ mute] . |
171+ | hold | Holding a call intent subject to [ CallKitCapability.supportHold] or [ CallKitCapability.hold] capability. |
172+ | unhold | Unholding a call intent, opposite of [ hold] . |
173+ | silence | Silencing an incoming call intent |
174+ | disableVideo | Disabling video (on a call with video/screen share) intent |
175+ | enableVideo | Enabling video (on a call with video/screen share) intent |
114176
0 commit comments