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

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?

1 Like

Both are using https I believe:


https://forum.ether.camp/

1 Like

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.

1 Like

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:

1 Like

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

The only SiteSettings that we use are title and apple_touch_icon_url.

https://github.com/discourse/discourse/blob/aa4dccd0a1c01dc216dca94c4a6a4b5760a545b9/app/controllers/metadata_controller.rb#L15

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.

1 Like

Hoho, found it!

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

1 Like

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

1 Like

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.

2 Likes