Criteria to ensure Discourse instance will work as a Chrome webapp on mobile

AI-generated summary

auryn_macmillan reported that two of their Discourse instances fail to behave as proper Chrome webapps on Android when added to the homescreen — instead opening in a regular Chrome tab. While most instances work correctly (showing splash screens and hiding the URL bar), these two do not. Falco initially suggested verifying HTTPS, which was confirmed. Investigation revealed that the manifest.json for https://forum.gnosis.pm/ was malformed. Falco suspected missing required fields, particularly apple_touch_icon_url, which auryn_macmillan confirmed was set. Further discussion revealed the issue was likely caused by the installed push notifications plugin, which interferes with the manifest generation. Falco noted that the plugin may require full configuration (including gcm_sender_id) or removal to function correctly. A fix is pending. auryn_macmillan confirmed disabling the plugin resolved the issue for one instance and plans to disable it on both until the plugin is fixed. The core criteria for proper webapp behavior appear to be: valid HTTPS, correctly configured manifest.json (including title and apple_touch_icon_url), and avoiding interference from misconfigured plugins like push notifications.

I have a few of instances of Discourse running for different projects. They are pretty much identical, other than a couple of minor CSS differences, but are behaving differently when I try to use the “Add to homescreen” option on chrome for android. The majority work without a hitch (imitating a native app; splash screen, no URL bar, etc), however two instances seem to simply put a shortcut on the homescreen and open up in a new tab in chrome.

Are there any specific criteria that I might have neglected to set up in the two misbehaving that might be causing this? (I’ve tested it across a couple of devices, so I’m confident I’m not the only one experiencing it).

As said here you need https. Can you share the links?

Both are using https I believe:

https://forum.gnosis.pm/
https://forum.ether.camp/

Both manifest.json is somehow broken. How they did it is beyond me.

Maybe they forgot to set a required field…

What are the required fields? And how would I go about fixing this?

My best guess is they didn’t set the apple_touch_icon_url SiteSetting. Try sending a PM to an admin and asking then.

I’m the admin for both.

apple_touch_icon_url for https://forum.gnosis.pm is:

mobile_logo_url for https://forum.gnosis.pm is:

Hahaha, you should’ve mentioned it earlier :stuck_out_tongue:.

The only SiteSettings that we use are title and apple_touch_icon_url.

Do you use any plugins? The push notifications one mess with this controller I think.

Yeah I have the push notifications plugin installed on both, I’ll try rebuilding one without and see if that fixes it.

Hoho, found it!

I think that just configuring the plugin may work. You either install and fill all the fields or uninstall.

all the fields?

There is a field called gcm_sender_id somewhere.

However, this should not happen anyway. This may fix it (still need some testing):

https://github.com/discourse/discourse-push-notifications/pull/7

disabling the plugin fixed it for https://forum.ether.camp.

I’ll just disable it on both for now, and re-enable it once it’s been fixed.

Thanks heaps for the help.