Reputation: 907
I just updated to Android O Preview and installed a few PWAs. On the home screen a miniature Chrome logo is placed by the icon. This wasn't there before the OS update.
Ideally, I would like the PWA to look like a regular app on the home screen considering it has service workers enabled.
Is it possible to remove this with some settings in the app.yaml or manifest.json?
Upvotes: 45
Views: 42660
Reputation: 618
In my case, I wanted to ship an app shortcut, which is a feature requiring an installable PWA. The app properly prompted me for the add to home screen, but installed the app as a shortcut with the browser badge instead of a “real” PWA.
My mistake was that I declared the app shortcut with 2 PNGs and 1 SVG as icons, while the article linked says:
SVG files are not supported at the time of writing. Use PNG instead.
My Web Manifest looked like this:
{
"name": "My app",
/* other Web Manifest members… */
"shortcuts": [
{
"url": "/new",
"name": "Name of this action",
"description": "Description of this action",
"icons": [
{ "src": "/icons/new-192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/icons/new-512.png", "sizes": "512x512", "type": "image/png" },
{ "src": "/icons/new.svg", "sizes": "150x150", "type": "image/svg+xml" }
]
}
]
}
This alone prevented the web app to be “installed” as expected. After the removal of the SVG line, it worked. The issue was in Chrome Android, not desktop.
Upvotes: 1
Reputation: 1325
In my case, this was because my *-maskable.png icon (the version of the icon that the PWA will use on its splash screen) had a 32-bit color depth.
It had this 32-bit color depth because my other icons (for the other sizes, for browser tabs, bookmarks and so on) had a transparent background, and therefore must be 32-bit.
However the maskable PNG must not have a transparent background. It must have a solid background (i.e. white) and be 24-bit color depth.
None of the tools above highlighted this problem for me :(
Upvotes: 2
Reputation: 258
Addition to other answers. User also need enough space on their device or else it will be installed as bookmark. This happened to me.
Upvotes: 3
Reputation: 4401
In 2021, this was happening to me on Android 11 and Chrome 92, so I looked around, generated a Lighthouse audit report and got told that the following two things need to be green:
For ideal appearance on iOS when users add a progressive web app to the home screen, define an
apple-touch-icon
. It must point to a non-transparent 192px (or 180px) square PNG. Learn More.
A maskable icon ensures that the image fills the entire shape without being letterboxed when installing the app on a device. Learn more..
There was also one more point about the HTTP not automatically redirecting to HTTPS, but after fixing the two points above, everything magically came alive and my Chrome as well as Edge properly show the app install prompt as well as the icon sans the Chrome/Edge icon.
FYI, the maskable icon link suggests using the following app: https://maskable.app/editor
Upvotes: 1
Reputation: 1521
Sometime we just miss one of the following, which stops us adding it as PWA to mobile:
https
instead of http
(easily get ignored).service worker
.manifest
file.Upvotes: 3
Reputation: 186
Note that if the phone doesn’t have a google play account enabled then all pwa will be installed as a bookmark only. This happened to us using a new phone to test our pwa
Upvotes: 17
Reputation: 10100
Above answer is not accurate except for the part that Chrome had the issue of adding Chrome badge to App icon, which is changed in the following updates.
Before getting into whats wrong, here is how web apps are added to home screen.
1) As a simple shortcut(like a bookmark), when the users web browser don't have service worker support(which all recent versions of major browsers have support now), targeted web URL don't have a valid manifest.json and service worker files configured(this can be validated in Application-> Manifest and Service worker tabs in chrome developer tools). In this case, what is added to home screen is not an APK and the bookmark kind of shortcut was represented by a specific version of Chrome with a badge.
2) As an installed APK: When the targeted URL have a valid Manifest.json, service workers and one of supported Chrome version is used, Chrome for Android uses WebAPK to build and sign an .APK file with the package name starting "org.chromium.webapk". Read here for more details on apk generation and PWA distribution here.
Whats not accurate in the above answer/linked article,
1) The chrome badge is not a security measure. Chrome team added the badge for web apps created as bookmark/URL shortcut as it was not using WebApk in some particular version. Badge is a simple visual representation which was later withdrawn.
2) PWA is not abandoned in favor of WebApk. WebApk is part of PWA solution, which compliments PWA by building an installable APK file to get the native app like behavior. WebApk is used to build .apk files by Chrome for Android. Here is official read me file.
So if you are building a PWA, you can still be assured you are not left behind in outdated/abandoned/being abandoned technology. Its still a constantly progressing positively, which got iOS support for service worker in march-2018(iOS 11.3), making it the last major browser vendor aboard PWA game.
Upvotes: 31
Reputation: 119
This is simple security measure as the PWA is literary opening the browser window and small icon signalizes which browser is used:
Starting with Android Oreo, every shortcut added from Chrome (and potentially other browsers as well, but they are not working now) will have a Chrome badge at the lower right corner of the icon.
Anyway, PWA seems to be abandoned as the new WebAPK feature is significantly more powerful and actually, supports normal icons
With WebAPK enabled, icons are back to normal as we were used in Android before Oreo
Source for quotes: https://medium.com/@firt/android-oreo-takes-a-bite-out-of-progressive-web-apps-30b7e854648f
Upvotes: 0