Iris
Iris copied to clipboard
Dynamic `manifest.json` with custom `short_name`
Problem to solve
Hey! I really like to use mopidy with the iris extension. Especially because it can be used very smooth on smartphones when using Chrome on Android and install the progressive web app. I've several raspberry pis at home running mopidy. Unfortunately I can't distinguish between the installed PWAs on my device, because all have the same name and icon.
Proposed solution
Provide configuration properties to specify short_name and name of the pwa manifest.
Additional info
No response
This will require some research, but because manifest.json
is part of the application bundle its ability to be modified realtime is somewhat limited. I think the approach would be to put it through a Tornado (the webserver) template.
The difficulty with modifying the manifest file is that changes can be difficult to propagate. Force clearing the cache as well as uninstalling the service worker seem necessary to achieve this.
Thanks for your reply! I think the issue with the cache can be handled with documentation. It might be possible to change an updatable field, too.
I've no experience with your solution and python web frameworks at all. But I see, that manifest.json is catch in its own request. So my strategy would be to create an explicit end point for /iris/manifest.json
which reads the base manifest from the bundle, make some string-search-and-replace before providing it to the client. Do you think, that this is possible?