Skip to content

Commit d88f01d

Browse files
committed
Merge branch 'master' into prod
2 parents ca5a3a4 + c9d5791 commit d88f01d

File tree

3 files changed

+51
-9
lines changed

3 files changed

+51
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.4+1
2+
3+
* Update documentation
4+
15
## 0.0.4
26

37
* Add `strictMode` to `CKConfiguration`

README.md

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ The following describes the standard call flow expected of the `CallState` enum.
3434

3535
### Browser notifications
3636

37-
Use native browser integration, the following limitations apply to each platform. Usage of Flutter
38-
package [js_notifications](https://pub.dev/packages/js_notifications) is assist in browser
39-
notification integration to native systems.
37+
Use native browser integration, the following limitations apply to each platform.
38+
39+
Usage of Flutter package [js_notifications](https://pub.dev/packages/js_notifications) is assist in
40+
browser notification integration to native systems.
4041
See [js_notifications > platform limitations](https://github.com/cybex-dev/js_notifications?tab=readme-ov-file#platform-limitations)
4142
for more information
4243

@@ -48,13 +49,36 @@ for more information
4849
import 'package:web_callkit/web_callkit_web.dart';
4950
```
5051

52+
### Copy service worker
53+
54+
Copy the service worker file named `js_notifications-sw.js` from the `example` directory to your web
55+
directory. _The name is very important, so make sure to have the file
56+
named `js_notifications-sw.js`._
57+
58+
The folder structure should look like this:
59+
60+
```
61+
your_project/
62+
├── ...
63+
├── lib/
64+
├── web/
65+
│ ├── index.html
66+
│ ├── js_notifications-sw.js
67+
```
68+
69+
**Note:** This is required for the browser to handle notifications in the background. The service
70+
worker will handle incoming call notifications and display them even when the app is not in focus.
71+
5172
### Display the system call screen
5273

5374
Inform the plugin that an incoming call is being received. This will hook into the browser
5475
notification system.
5576

5677
```dart
57-
WebCallKitWeb.instance.displayIncomingCall(uuid: '1234',handle: 'John Doe',);
78+
WebCallKitWeb.instance.displayIncomingCall
79+
(
80+
uuid: '1234',handle: 'John Doe',
81+
);
5882
```
5983

6084
### End the call
@@ -92,7 +116,10 @@ Incoming calls are displayed on the screen with the caller's name and number. Th
92116
customized with the caller's name, number, and profile picture.
93117

94118
```dart
95-
WebCallKitWeb.instance.reportNewCall(uuid: '1234', handle: 'John Doe',);
119+
WebCallKitWeb.instance.reportNewCall
120+
(
121+
uuid: '1234', handle: 'John Doe',
122+
);
96123
```
97124

98125
##### End Calls
@@ -101,7 +128,14 @@ End calls by calling the `endCall` method. This will remove the call screen and
101128
notification.
102129

103130
```dart
104-
WebCallKitWeb.instance.reportCallDisconnected('1234', response:DisconnectResponse.local);
131+
WebCallKitWeb.instance.reportCallDisconnected
132+
('1234
133+
'
134+
, response:
135+
DisconnectResponse
136+
.
137+
local
138+
);
105139
```
106140

107141
The response parameter is an enum of `DisconnectResponse` which specifies the reason for the call
@@ -123,7 +157,8 @@ The following described scenarios are valid DisconnectResponses for specific cal
123157
| disconnecting | local, remote, unknown, error, |
124158
| disconnected | local, remote, unknown, error, |
125159

126-
if `strictMode` is enabled, the following valid `DisconnectResponse`s will be considered, else it will be rejected (and potentially thrown) in a future update.
160+
if `strictMode` is enabled, the following valid `DisconnectResponse`s will be considered, else it
161+
will be rejected (and potentially thrown) in a future update.
127162

128163
#### Notification Integration
129164

@@ -147,7 +182,10 @@ The following describes the capabilities available:
147182
The following provides an example of how to report call capabilities:
148183

149184
```dart
150-
WebCallKitWeb.instance.reportCallCapabilities('1234', capabilities: [CallCapability.hold, CallCapability.mute]);
185+
WebCallKitWeb.instance.reportCallCapabilities
186+
('1234
187+
'
188+
, capabilities: [CallCapability.hold, CallCapability.mute]);
151189
```
152190

153191
#### Call Actions

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: web_callkit
22
description: "Manage calls with an iOS-inspired Callkit for Flutter Web applications."
3-
version: 0.0.4
3+
version: 0.0.4+1
44
homepage: "https://github.com/cybex-dev/web_callkit"
55
platforms:
66
web:

0 commit comments

Comments
 (0)