Skip to content

Commit 479f75c

Browse files
committed
Merge branch 'master' into prod
2 parents e1d8e4c + bb33ff0 commit 479f75c

File tree

81 files changed

+6047
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+6047
-1
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: '🐞 Bug Report'
3+
about: Create a report
4+
title: ''
5+
labels: ['type:Bug', 'status:Unconfirmed']
6+
assignees: ''
7+
---
8+
9+
<!--
10+
Found a bug? Please fill out the sections below. 👍
11+
-->
12+
13+
### Issue Summary
14+
15+
<!--
16+
A summary of the issue.
17+
-->
18+
19+
### Steps to Reproduce
20+
21+
1.
22+
23+
Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead?
24+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: '🚀 Feature request'
3+
about: Suggest an idea/concept/feature to enhance the project
4+
title: ''
5+
labels: 'type:Enhancement'
6+
assignees: ''
7+
---
8+
9+
### Is your proposal related to a problem?
10+
11+
<!--
12+
Provide a clear and concise description of what the problem is.
13+
-->
14+
15+
(Write your answer here.)
16+
17+
### Describe the solution you'd like
18+
19+
<!--
20+
Provide a clear and concise description of what you want to happen.
21+
-->
22+
23+
(Describe your proposed solution here.)
24+
25+
### Describe alternatives you've considered
26+
27+
<!--
28+
Let us know about other solutions you've tried or researched.
29+
-->
30+
31+
(Write your answer here.)
32+
33+
### Additional context
34+
35+
<!--
36+
Is there anything else you can add about the proposal?
37+
You might want to link to related issues here, if you haven't already.
38+
-->
39+
40+
(Write your answer here.)

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Description
2+
3+
Please include a summary of the change(s) and which issue(s) are to be fixed/addressed or feature(s) to be added. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
6+
## Type of change
7+
8+
Please delete options that are not relevant.
9+
10+
- [ ] Bug fix (non-breaking change which fixes an issue)
11+
- [ ] New feature (non-breaking change which adds functionality)
12+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
13+
- [ ] This change requires a documentation update
14+
15+
## Screenshots (if appropriate):

.github/workflows/flutter-prod.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Flutter analyze, test & deploy example web app
7+
8+
on:
9+
push:
10+
branches: [ "prod" ]
11+
12+
workflow_dispatch:
13+
14+
jobs:
15+
build_and_test:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install Flutter
23+
uses: subosito/flutter-action@v2
24+
with:
25+
flutter-version: '3.22.0'
26+
channel: 'stable'
27+
cache: true
28+
29+
- run: flutter --version
30+
31+
- name: Install dependencies
32+
run: flutter pub get
33+
34+
- name: Analyze project source
35+
run: flutter analyze
36+
37+
- name: Run tests
38+
# run: flutter test --coverage
39+
run: echo "Ignoring tests for now."
40+
41+
deploy-example-web:
42+
runs-on: ubuntu-latest
43+
needs: build_and_test
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Setup Flutter build environment
49+
uses: subosito/flutter-action@v2
50+
with:
51+
flutter-version: '3.22.0'
52+
channel: 'stable'
53+
cache: true
54+
55+
- run: flutter config --enable-web
56+
- run: cd ./example; flutter build web --release --target=lib/main.dart --output=build/web
57+
58+
- name: Archive Production Artifact
59+
uses: actions/upload-artifact@master
60+
with:
61+
name: web-build
62+
path: example/build/web
63+
64+
- name: Firebase Deploy
65+
uses: FirebaseExtended/action-hosting-deploy@v0
66+
with:
67+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
68+
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WEB_CALLKIT }}'
69+
projectId: web-callkit
70+
channelId: live
71+

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ doc/api/
2525

2626
.flutter-plugins
2727
.flutter-plugins-dependencies
28+
29+
.idea/
30+
31+
.DS_Store

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

README.md

Lines changed: 114 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,114 @@
1-
# web_callkit
1+
# web_callkit
2+
3+
**This project is a Web Flutter plugin that facilitates handling of calls.**
4+
5+
Inspired by the iOS CallKit framework, this plugin provides the boilerplate to manage calls via a
6+
simple API and provides a browser call control mechanism through browser notifications.
7+
8+
### Notes
9+
10+
Due to many voip providers e.g. twilio-voice.js providing their own SDKs and audio handling (
11+
incoming ringing, etc), this plugin is intended to be used as a boilerplate for call management and
12+
not as a full-fledged voip solution.
13+
14+
A bird's eye overview/usage of the plugin:
15+
16+
- Notify callkit of an incoming call
17+
- Update state of call from VOIP/SIP provider
18+
- Add/update call capabilities (hold, mute, etc)
19+
20+
## Features
21+
22+
- Boilerplate for call management
23+
- Integration with browser notifications
24+
- Support background calls
25+
- Custom audio sounds for incoming calls, etc.
26+
27+
### Call State flow
28+
29+
![](https://raw.githubusercontent.com/cybex-dev/web_callkit/refs/heads/master/doc/images/callflow.png)
30+
31+
## Limitations
32+
33+
### Browser notifications
34+
35+
Use native browser integration, the following limitations apply to each platform. Usage of Flutter
36+
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)
38+
for more information
39+
40+
## Installation
41+
42+
### Import the package
43+
44+
```dart
45+
import 'package:web_callkit/web_callkit.dart';
46+
```
47+
48+
### Display the system call screen
49+
50+
Inform the plugin that an incoming call is being received. This will hook into the browser
51+
notification system.
52+
53+
```dart
54+
WebCallKit.instance.displayIncomingCall(
55+
uuid: '1234',
56+
handle: 'John Doe',
57+
);
58+
```
59+
60+
### End the call
61+
62+
End the call by calling the `endCall` method. This will remove the call screen and stop the browser
63+
notification. Calls are disconnected for various reasons, via local user requests or remote errors
64+
or disconnects with VoIP calls due to internet disruptions.
65+
66+
The CallKit supports `DisconnectResponse` enum to specify the reason for the call disconnection.
67+
68+
e.g. `WebCallKit.instance.reportCallDisconnected('1234', response: DisconnectResponse.local);`
69+
70+
| Reason | Description |
71+
|----------|---------------------------------------------------------------------------------------|
72+
| local | Disconnect due to a local end call request. |
73+
| remote | Disconnect due to a remote end call request or remote party failed to answer in time. |
74+
| canceled | Disconnect due to a call was cancelled. |
75+
| missed | Disconnect due to a incoming call was not answered in time. |
76+
| rejected | Disconnect due to incoming call was rejected. |
77+
| busy | Disconnect due to remote party being busy. |
78+
| error | Disconnect due to an error. |
79+
| unknown | Disconnect response is unknown. |
80+
81+
### Features
82+
83+
#### Call Management
84+
85+
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. |
94+
95+
##### Incoming Calls
96+
97+
Incoming calls are displayed on the screen with the caller's name and number. The call screen can be
98+
customized with the caller's name, number, and profile picture.
99+
100+
```dart
101+
WebCallKit.instance.reportNewCall(
102+
uuid: '1234',
103+
handle: 'John Doe',
104+
);
105+
```
106+
107+
#### Notification Integration
108+
109+
#### Capabilities
110+
111+
## Limitations / Future work
112+
113+
- Support video & desktop streaming natively
114+

analysis_options.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
# Additional information about this file can be found at
4+
# https://dart.dev/guides/language/analysis-options

doc/images/callflow.png

40.4 KB
Loading

0 commit comments

Comments
 (0)