Skip to content

Commit 3d88c98

Browse files
committed
Merge branch 'master' into prod
2 parents 7e4bb90 + ee2acc5 commit 3d88c98

33 files changed

+1393
-1332
lines changed

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## 0.0.2+1
2+
3+
* Add browser permission check
4+
* Update changelog
5+
6+
## 0.0.2
7+
8+
* Rework Notification Manager
9+
* Updated call notification API
10+
* Added CallkitCapability, CallState and CallActions
11+
* Add call timer
12+
* Added & update documentation
13+
* Update example
14+
115
## 0.0.1
216

3-
* TODO: Describe initial release.
17+
* Initial Commit

NOTES.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Notes
2+
3+
The plugin is intended to be used as a boilerplate for call management and not as a full-fledged voip solution. The plugin facilitates handling of calls via a simple API and provides a browser call control mechanism through browser notifications.
4+
5+
_Thus, core features such as audio handling, RTC/SIP connections, websocket communication, etc. are not provided by the plugin and should be handled via 3rd party resources._
6+
7+
Core tenets of the plugin:
8+
1. Transparency: the user should at all times be aware of any call on their device.
9+
2. Accessibility: the user should be able to interact with the call in any state.
10+
3. (Future work) flexibility within the Callkit structure.
11+
12+
Future work may include:
13+
- Integration with RTC/SIP connections
14+
- Websocket communication
15+
- Audio & VIDEO handling
16+
- Integration with native callkit frameworks
17+

README.md

Lines changed: 82 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3537
Use native browser integration, the following limitations apply to each platform. Usage of Flutter
3638
package [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)
3841
for more information
3942

4043
## Installation
4144

42-
### Import the package
45+
### Import the package
4346

4447
```dart
4548
import '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
5154
notification 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

8585
CallKit 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

9791
Incoming calls are displayed on the screen with the caller's name and number. The call screen can be
9892
customized 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

TODO.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# TODO
2+
3+
* Add DisplayType to determine how call notifications are displayed/grouped together
4+
* Individual
5+
* Grouped
6+
* GroupAfter3
7+
* Add images to enhance callkit UI
8+
* Active
9+
* Holding
10+
* Muted
11+
* Incoming
12+
* Ringing
13+
* Disconnecting
14+
* AudioManager

0 commit comments

Comments
 (0)