Fully support Android Chrome's "Add to Homescreen"

I think background_color and theme_color should be moved under colors customization.

Does background_color sets it to grey as per your video? That is making stuff very difficult to read. :slight_smile:

3 Likes

It uses Discourse color customization already, the secondary color for background and header background for theme color.

I used those colors on the video just to show it matches customizations automatically.

Sorry what I meant is that the color customisation should only target either the theme_color or the background_color. I think we’ll want to avoid a case where setting a secondary color ends up affecting the background color as well. For the theme_color, I think it is safe to default to the header color. :smile:

1 Like

I’m not following sorry :sadpanda:

Now it is:

  • Header color on discourse = theme color (Android top bar background)

  • Background color on discourse = background color on splash screen

secondary
The main background color

Ah ic. :grin: sorry for confusing you

1 Like

Discourse just need app banners and browser push notifications to be app level now.

Is the team happy with a dummy service worker just to get app banner rolling?

We app now :laughing:

This PR adds App Banner Support for Android :fireworks:

https://github.com/discourse/discourse/pull/4103

I just got in and made the minimum necessary for the feature, so please see if it is up to Discourse standards.

6 Likes

Wait so we will be nagging every Android user to make every Discourse website a homepage icon??

According to Google it does:

  • Appear on the second visit:
    The user has visited your site at least twice, with at least five minutes between visits.

  • If the user dismiss the banner it never comes back:
    If a user dismisses the banner, will it appear again? No. Not unless the user clears their history. We want to make sure users have a good experience. We will likely be changing all the heuristics over time.

The implementation can get better, we can defer the banner till we feel like.

Also, we can log Dismiss and Accept to make some stats.

8 Likes

Looks like you’re working on this one which is great because this is linked with my earlier post about trying to get as much screen real estate as possible when in landscape mode. I remembered that I’d used this feature to add a home page icon for www.whatpub.com and after doing that, the Google toolbar is missing, i.e. it’s full screen and looks much more like a native app. However when I’ve just tried this with Discourse, it’s stuck in portrait mode - rotate to landscape doesn’t work. Rotate does work with home page shortcuts as www.whatpub.com rotates happily.

Thumbs up for more app like feeling. “Why isn’t there an app for Discourse” is something that has been asked in our trial of the platform. Not an entirely easy answer for non-technical users.

1 Like

Nice, this is the idea. With app banners landing somewhere after March (1.6 beta start) it will be even easier to non-tech to “install” Discourse.

Looks like the orientation on the manifest file isn’t a suggestion, but rather a lock :sadpanda:. I will test when at home if I can safely remove this.

1 Like

Any other tweaks needed here @falco?

1 Like

Yes.

I need to:

  • Check portrait lock
  • Instantiate the service worker only on Android as per @eviltrout advice.

This week I can fix those.

5 Likes

I just did the changes pointed by @eviltrout

I’m open to make any adjustments.

2 Likes

Loaded this today on Meta and my own site. Very nice!

But a question, how do I change the icons? Home screen icon is not matching our favicon and the splash screen is blank.

Also some people have the option and some don’t …

1 Like

It’s using apple_touch_icon_url,

It shows following google rules.

4 Likes

Great work on this! :fonzie:

You’re very welcome to start a (linked) fresh topic to properly introduce the feature, that way it’s easier to share in a tweet as well :wink:

2 Likes

I did manually remove both and then manually re-add them using the Chrome menu “Add to Home Screen” because I wanted a shorter title under the icon, e.g. just “Meta”. :slight_smile:

Discussion continued here: