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
Adding the webapp's badge to the manifest #480
Comments
Some platforms (e.g. android) show a monochrome badge. Any ideas of how we'd allow sites to specify a monochrome badge and a color one? |
Different platforms take completely different approaches in displaying badges. You mention Android, it's not only monochrome, but it also limits display to non-transparent pixels. (Discarding partial transparency.) The actual colour may also display on, for example, theming. Notifications has the following note that, incidentally, should be updated to mention badges as well.
|
We had related discussions to this previously on the WHATWG list. And: tl;dr: we need "badged-tasks API" for this (yes, with a less terrible name), where those tasks are reflected as badge numbers or similar. I'm traveling this week, so can only write a short reply. Would be great to discuss further. |
@marcoscaceres I don't think this is about showing a number badge, like unread emails. @beverloo can you show some screenshots of where you intend this to be used? It is like an overlay right, like a gmail logo on top of a profile pic etc, right? |
Correct, this talks about badges as in status bar icons, following Notification API terminology. I took two screenshots on Android, but it's effectively the same on all mobile platforms. Desktop platforms may choose to badge their toasts as well for additional attribution. Badges in the status bar, and badges on the notifications. Again, this issue is about being able to provide an icon that replaces the UA's icon in these scenarios with something appropriate for the webapp, in situations where the developer currently can't. |
Seems to me like this is very similar to the monochrome SVG icon that e.g. desktop Safari uses for their (fairly) new Pinned Sites (in the tab bar). So would it perhaps be an option to solve it via additional attributes or attribute values for |
Ah, apologies for misunderstanding.
|
So these are basically black/white (and inverted) images. Would be nice to specify these in a cross platform way. |
So there is a need for these at least on Android. On iOS tho, the the app icons are used. However, couldn't this just be added when the notification is created instead of having a generic icon? Or is there no option for that on Android (i.e., you have to specify the application's icon for notification up-front)? |
Browsers currently use their own icons on Android, but that's definitely not sufficient for branding. That's why the per-notification option was introduced. This is insufficient in two cases:
@skddc It might be, but my concern is that it may be confusing when this happens since it'll be displayed in a different context, much smaller and often with a mask applied. @kenchris We shied away from this in the Notification API because you'd end up defining operating system behaviour that's out of our control. It has a note indicating that certain resources can be modified by the OS to match platform consistency. |
@beverloo, mabye we want is to enhance image objects with a "purpose" or "role" (though {
"icons": [ {
"src": "icon/android/badge.png",
"purpose": "badge",
"platform": "android"
}, {
"src": "icon/app.png"
}]
} |
Wouldn't the platform member be rather prone to misuse? That is, some parties/platforms would likely use other platforms' icons then, because developers can't specify (or even know) all existing and future platforms (esp. the smaller ones). Furthermore, platforms might change what style they use with new major versions. I think this should be defined more as style or maybe purpose. A small monochrome icon like this could be used on many platforms and in many places. Maybe it also helps to look at how Apple currently solves this for their use case (even supporting an icon color): https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/pinnedTabs/pinnedTabs.html |
Related: #361 (comment) |
Maybe all we need is the "purpose" then. |
Fixed comment above. |
Sent proposal: (WIP) |
I'd like to propose adding a
badge
property to the Manifest.Authors would use this property to indicate a small icon that should be used to represent their webapp in space constrained locations, for example the status bar of a mobile device. Such badges are consistently displayed differently from regular icons, so using the smallest
icons
value (or a favicon for that matter) does not seem appropriate.Today, both Chrome and Firefox show their respective logos in the status bar when showing a notification. This portrays no information to the user other regarding the source of the notification.
Web Notifications have a property called
badge
(spec) in which the developer can provide their own icon, but this is still significantly constrained by platform limitations (only ~13% of Android users have the necessary platform support).In addition, there are various situations in which the browser shows notifications on behalf of the webapp.
Allowing authors to specify their webapp's badge in the manifest enables a more consistent experience for such browser-level notifications. Knowing which icon to badge notifications with at installation time makes it possible to work around these platform limitations, too.
Thoughts?
The text was updated successfully, but these errors were encountered: