![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
chat-engine-desktop-notifications
Advanced tools
Show a desktop notification when a message is received and app is not in focus.
Show a desktop notification when a message is received and app is not in focus.
The desktop notification plugin is straight forward to implement. The following are supported and tested browsers:
Browser | Supported | Last Validated Version |
---|---|---|
Chrome | Yes | v.68 |
Firefox | Yes | v.61 |
Safari | Yes | v.11.1 |
Opera | Yes | v.55 |
IE | ? | N/a |
npm install chat-engine-desktop-notifications --save
CE currently supports the following options for displaying desktop notifications.
For additional configuration please refer to the following (MDN reference)[https://developer.mozilla.org/en-US/docs/Web/API/notification].
let desktopNotificationsConfig = {
title: (event) => {
return '<INSERT_MSG_TITLE_HERE>'
},
message: (event) => {
return event.data.text; // (default) displays CE message text for the room
},
icon: (event) => {
return './pn-cloud.png';
},
callback: (event) => {
window.focus();
}
}
Then to initialize, attach the plugin to the ChatEngine.chat
object:
ChatEngine.chat.plugin(
ChatEngineCore.plugin['chat-engine-desktop-notifications'](desktopNotificationsConfig)
);
By default, the CE desktop notification plugin handles the prompting the user to Show Notifications.
To instantiate this earlier, place the following snippet within your initialization code for CE:
Notification.requestPermission().then((res) => {
console.log(res);
});
To see the desktop notifications example in action, add your CE pub/sub keys to '''example/desktop.js''' and then run the following:
cd example
npm install
http-server
Open a supported browser to 127.0.0.1:8080
and open the desktop.html file.
FAQs
Show a desktop notification when a message is received and app is not in focus.
The npm package chat-engine-desktop-notifications receives a total of 3 weekly downloads. As such, chat-engine-desktop-notifications popularity was classified as not popular.
We found that chat-engine-desktop-notifications demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.