Skip to content

Run twilio service worker next to flutter service worker #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mortht
Copy link

@mortht mortht commented Apr 22, 2025

Run twilio service worker next to flutter service worker instead of replacing it.

Thx for the twilio-voice package and the example app.

I'll tried to find a way to get rid of the manual post-build step replace the twilio-sw.js file.
Here is what I came up with. Let me know what you think.

Kind regards,
Thiemo

@cybex-dev
Copy link
Owner

Hi Thiemo,

This solution initially worked but was not reliable in sending messages to the SW. If memory serves, it had some trouble in production too.

For this reason, I've created packages:

  • js_notifications to address the lack of customisable notifications on Flutter Web
  • web_callkit as a drop in replacement for call management on Flutter Web

These 2 have been added in 0.3.x with minor version bump, see: 9fdd508

Loading these javascript files as a blob or pre-loading in HTML seems to cause some problems - this is however something I hope to address soon.

@cybex-dev cybex-dev self-assigned this Jun 16, 2025
@cybex-dev cybex-dev self-requested a review June 16, 2025 09:40
Copy link
Owner

@cybex-dev cybex-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As easy as this solution would be, it has unfortunately caused some issues for Flutter to find the managed service worker, thus sending messages to the SW fail. The only solution is a "hack" I left in by requesting the user to soft refresh the page.

@cybex-dev cybex-dev added the web label Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants