hoangviet
(DilysLena)
October 8, 2024, 7:01am
1
Users cannot add topic pages to the mobile screen (when opening a topic). When clicking add on the screen, only the home page can be added.
I hope the Discourse community can guide me on how to fix this.
in the image, both options add the home page to the mobile screen. The user does not add the topic to the mobile screen
Hmm… I’m not sure if the topic page not being a shortcut is Discourse’s fault. It is odd, though, since I have bookmarked specific pages of the blog before.
hoangviet
(DilysLena)
October 8, 2024, 7:58am
3
i mean how to handle it, i want to allow my users to add topic page to mobile screen
nat
(Natalie T)
October 8, 2024, 9:11am
4
I don’t think that is possible unfortunately.
The “Add to Home Screen” functionality requires every web app to define a start_url
, in which we have defined it as the root URL of your forum.
Here’s what our a2hs manifest looks like:
icon_url_base =
UrlHelper.absolute("/svg-sprite/#{Discourse.current_hostname}/icon/#{primary_color}")
manifest = {
name: SiteSetting.title,
short_name:
SiteSetting.short_title.presence ||
SiteSetting.title.truncate(12, separator: " ", omission: ""),
description: SiteSetting.site_description,
display: display,
start_url: Discourse.base_path.present? ? "#{Discourse.base_path}/" : "/",
background_color: "##{ColorScheme.hex_for_name("secondary", scheme_id)}",
theme_color: "##{ColorScheme.hex_for_name("header_background", scheme_id)}",
icons: [],
share_target: {
action: "#{Discourse.base_path}/new-topic",
method: "GET",
enctype: "application/x-www-form-urlencoded",
params: {
title: "title",
text: "body",