Closed danry25 closed 12 months ago
whoops! stupid chrome requirement, fix here is very easy. add userVisibleOnly: true
to https://github.com/AccelerateNetworks/fusionpbx-webtexting/blob/main/webtexting.js#L48 and it should work. No frontend rebuild required. When fixed the line will look like this:
subscription = await registration.pushManager.subscribe({ applicationServerKey: convertedVapidKey, userVisibleOnly: true });
Hmm, I tested this in Chromium (Version 116.0.5845.180 (Official Build) built on Debian 12.1, running on Debian 12.2 (64-bit)) but it doesn't seem to resolve the DOMException, getting the same userVisibleOnly error.
There's another place you need to add the userVisibleOnly:true option on line 105 of webtexting.js Before: const state = await registration.pushManager.permissionState(); After: const state = await registration.pushManager.permissionState({userVisibleOnly:true});
Chrome doesn't show the push notification prompt due to this error in production web texting.
Uncaught (in promise) DOMException: Push subscriptions that don't enable userVisibleOnly are not supported.