Skip to content

Commit 3e85450

Browse files
authored
Merge pull request #164 from cybex-dev/fix_web_notification_interactions
Fix notification actions and callbacks
2 parents fdb6432 + a756abd commit 3e85450

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## Next release
2+
23
* Feat: [Android] Turn off the screen when a call is active and the head is against the handset. @solid-software (https://solid.software)
34
* Feat: [macOS] Added support for macOS, based on iOS implementation backed by Twilio Voice Web (twilio-voice.js [v2.4.1-dev-custom](https://github.com/cybex-dev/twilio-voice.js/tree/2.4.1-dev-custom)).
45
* Feat: [Web] Web support with notifications (via Service Worker) with live example at https://twilio-voice-web.web.app @cybex-dev
@@ -7,7 +8,7 @@
78
* Feat: [iOS] Add support for changing callkit icon (future plans to extended this for Flutter assets) @cybex-dev
89
* [twilio_voice_mimp:0.2.5) fix 4 Null Pointer execption Android
910
* [twilio_voice_mimp:0.2.4) add Android DE Local
10-
* [twilio_voice_mimp:0.2.4) add Android IT Local
11+
* [twilio_voice_mimp:0.2.4) add Android IT Local
1112
* [twilio_voice_mimp:0.2.3) Upgrade to Twilio Android SDK 6.1.2 / iOS SDK 6.4.2
1213
* [twilio_voice_mimp:0.2.3) small Bugfix for null pointer Exception
1314
* [twilio_voice_mimp:0.2.2) more Magic is needed with FLAG_MUTABLE (Android 12)
@@ -39,29 +40,37 @@
3940
* Fix: [Android] Incorrect call direction for incoming calls
4041
* Fix: call ringing event always showing `CallDirection.outgoing`
4142
* Fix: [Android] Updated CallKit incoming/outgoing name parameter resolution
43+
* Fix: [Web] Notification actions working intermittently.
4244

4345
## 0.0.9
46+
4447
* Feat: forwarded callInvite custom parameters to flutter
4548

4649
## 0.0.8
50+
4751
* Renamed callkit logo
4852
* Merge-Android: Fixed null pointer exception for eventSink occurs in mute call. @GKPK
4953

5054
## 0.0.7
55+
5156
* Fixed from param on android
5257

5358
## 0.0.6
59+
5460
* Added android extra call params
5561

5662
## 0.0.5
63+
5764
* Updated Twilio SDK versions
5865
* Added example proguard-rules.pro for android
5966

6067
## 0.0.4
68+
6169
* Fixes deprecation error with Xcode 12.5
6270
* removed "client" from ids
6371

6472
## 0.0.3
73+
6574
* Added missed call notifications
6675
* Updated Android SDK
6776
* Added localization files

example/web/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
<body>
4343
<!--twilio native js library-->
4444
<script type="text/javascript" src="./twilio.min.js"></script>
45-
<!--twilio native js library-->
46-
<script type="text/javascript" src="./notifications.js"></script>
4745

4846
<script type="text/javascript" src="./load-sw.js"></script>
4947

example/web/twilio-sw.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ function focusClientWindow() {
110110
self.clients.matchAll({
111111
type: "window",
112112
}).then((clients) => {
113-
for (const client of clients) {
114-
if (client.url === "/" && "focus" in client) return client.focus();
115-
}
116-
if (clients.openWindow) return clients.openWindow("/");
117-
}).catch((error) => {
118-
_error('Could not focus client window', error);
113+
clients
114+
.filter(value => !value.focused)
115+
.filter(value => "focus" in value)
116+
.forEach((client) => {
117+
client.focus().catch((error) => _error('Error focusing client window', error));
118+
});
119119
});
120120
}
121121

0 commit comments

Comments
 (0)