Web Tools #557 - App Badges, SVG Tools, Databases, Uncats
source link: https://mailchi.mp/webtoolsweekly/web-tools-557
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
App Badges, SVG Tools, Databases, Uncats
|
Issue #557 • March 21, 2024
Advertisement
|
The #1 All-In-One Platform Your Team Needs Picture a world where workflows are finely tuned, automated to perfection, and seamlessly integrated with your favorite apps. It's not just a platform; it's a revelation—a space where managers gain unparalleled visibility into team processes, ensuring each project is a resounding success. Step into the future of work management with monday.com, where efficiency isn't a goal; it's a given. From startups to industry giants, monday.com has transformed how teams work. Why not let your team be the next success story? Start your free trial today. |
Here's an interesting Web API that you may not have heard of yet: the Badging API. As the name suggests, this API is used to allow apps to push notification badges onto an app's icon, to indicate something is available. Of course, many users find these types of notifications annoying and are part of the endless notifications problem we have on our devices nowadays. But as developers, it's good to know the web platform now has a similar feature for use with web apps.
There's two primary methods used in the code above: setAppBadge() and clearAppBadge(). When setting the badge, you can pass in a single parameter representing the contents you want to display. The contents can be any number, and the badge will ignore any decimal values, displaying only the integer (it apparently won't do any rounding).
Try it out on a supporting browser by installing the app then using the controls on the page to change the badge value. Try setting the value to "0". Take note of the behaviour of the app icon (in the taskbar, on your home screen, etc., depending on which device you're testing). |
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK