12-05-2024, 04:47 PM
TL;DR:
Some time ago I noticed that the "Progressive Web App" feature that allows the moOde UI to be launched in a full screen native app style interface on mobile devices had stopped working for new installations on Android devices. Existing apps on the home screen would continue to operate as normal, but a new "add to homescreen" now always just opens a new browser instance with address bars and tabs and all the other clutter that PWA was supposed to avoid. I decided to investigate, here's a dump of what I discovered.
Doing some research led me to suspect that the culprit was that PWAs need to be served over https. So I set about enabling the (experimental) https mode in one of my moOde players. The first hurdle was using the automatic mode, the certificate generated there just would not install on my phone, so I couldn't get any browser to trust the https connection to moOde. OK, so let's set ourselves up as a CA and authorise our own certificate, plenty of advice on how to do that on the internet, I mostly followed a guide on askssl.com. Quite a bit of other fiddling needed, but that's not the subject of this post, I might write that up later... Upshot is that I got a secure connection to my moOde installation from a browser on my phone in the end.
The "add to homescreen" when using ssl in Chromium based applications now changed to "open app", which did just that, opened the moOde interface in an app like window. Everything worked well enough in terms of the moOde interface, but there was no way to add a launch icon to the homescreen. Swapping to any other app would close the web app with no way back but to open the web browser again and use the "open app" command again.
A nose around in the moOde code (header.php) revealed that the link to the manifest json file is commented out, there are instructions that seems to be for IOS, and I suppose those are what was allowing the partial behaviour, but with the manifest missing I don't think the Android experience would be as good as it could be. I don't know when that change was made, or why, but it is simple to uncomment and reboot. Voila!, "open app" became "Install app" and that allows an app like experience to be installed.
The App experience would need a bit of finessing to make it really useable again I think; the top bar with the clock, notifications and system icons vanished behind a solid black bar for one thing. Very different to how it looks on a PWA installed before the Chromium upgrades that broke it in the first place. I'm sure playing with the manifest and so on could fix all that, but at this point I stopped poking around and reverted back to http and undid my hacks. I still happen to have old PWA links to all my players, so I still use those day to day. It was an interesting little excursion though and the things I found may be of use to others who might ant to go further down the path.
- New PWA installations of the moOde on Android stopped working some time ago.
- Correctly configuring SSL on moOde and the Android phone, and re-applying the manifest in header.php restores the basic functions of PWA.
- The PWA would need a bit more work to make it as good as before even so.
Some time ago I noticed that the "Progressive Web App" feature that allows the moOde UI to be launched in a full screen native app style interface on mobile devices had stopped working for new installations on Android devices. Existing apps on the home screen would continue to operate as normal, but a new "add to homescreen" now always just opens a new browser instance with address bars and tabs and all the other clutter that PWA was supposed to avoid. I decided to investigate, here's a dump of what I discovered.
Doing some research led me to suspect that the culprit was that PWAs need to be served over https. So I set about enabling the (experimental) https mode in one of my moOde players. The first hurdle was using the automatic mode, the certificate generated there just would not install on my phone, so I couldn't get any browser to trust the https connection to moOde. OK, so let's set ourselves up as a CA and authorise our own certificate, plenty of advice on how to do that on the internet, I mostly followed a guide on askssl.com. Quite a bit of other fiddling needed, but that's not the subject of this post, I might write that up later... Upshot is that I got a secure connection to my moOde installation from a browser on my phone in the end.
The "add to homescreen" when using ssl in Chromium based applications now changed to "open app", which did just that, opened the moOde interface in an app like window. Everything worked well enough in terms of the moOde interface, but there was no way to add a launch icon to the homescreen. Swapping to any other app would close the web app with no way back but to open the web browser again and use the "open app" command again.
A nose around in the moOde code (header.php) revealed that the link to the manifest json file is commented out, there are instructions that seems to be for IOS, and I suppose those are what was allowing the partial behaviour, but with the manifest missing I don't think the Android experience would be as good as it could be. I don't know when that change was made, or why, but it is simple to uncomment and reboot. Voila!, "open app" became "Install app" and that allows an app like experience to be installed.
The App experience would need a bit of finessing to make it really useable again I think; the top bar with the clock, notifications and system icons vanished behind a solid black bar for one thing. Very different to how it looks on a PWA installed before the Chromium upgrades that broke it in the first place. I'm sure playing with the manifest and so on could fix all that, but at this point I stopped poking around and reverted back to http and undid my hacks. I still happen to have old PWA links to all my players, so I still use those day to day. It was an interesting little excursion though and the things I found may be of use to others who might ant to go further down the path.
----------------
Robert
Robert