mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 10:31:10 +08:00
FEATURE: Opt-in native Discourse app install banner on Android/iOS
This commit is contained in:
@ -13,7 +13,7 @@ class MetadataController < ApplicationController
|
|||||||
private
|
private
|
||||||
|
|
||||||
def default_manifest
|
def default_manifest
|
||||||
{
|
manifest = {
|
||||||
name: SiteSetting.title,
|
name: SiteSetting.title,
|
||||||
short_name: SiteSetting.title,
|
short_name: SiteSetting.title,
|
||||||
display: 'standalone',
|
display: 'standalone',
|
||||||
@ -29,5 +29,19 @@ class MetadataController < ApplicationController
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if SiteSetting.native_app_install_banner
|
||||||
|
manifest = manifest.merge({
|
||||||
|
prefer_related_applications: true,
|
||||||
|
related_applications: [
|
||||||
|
{
|
||||||
|
platform: "play",
|
||||||
|
id: "com.discourse"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
manifest
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -47,6 +47,10 @@
|
|||||||
<%= render_google_universal_analytics_code %>
|
<%= render_google_universal_analytics_code %>
|
||||||
<link rel="manifest" href="<%= Discourse.base_uri %>/manifest.json">
|
<link rel="manifest" href="<%= Discourse.base_uri %>/manifest.json">
|
||||||
|
|
||||||
|
<%- if SiteSetting.native_app_install_banner? %>
|
||||||
|
<meta name="apple-itunes-app" content="app-id=1173672076">
|
||||||
|
<%- end %>
|
||||||
|
|
||||||
<%= yield :head %>
|
<%= yield :head %>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -1367,6 +1367,8 @@ en:
|
|||||||
|
|
||||||
topic_page_title_includes_category: "Topic page title includes the category name."
|
topic_page_title_includes_category: "Topic page title includes the category name."
|
||||||
|
|
||||||
|
native_app_install_banner: "Asks recurring visitors to install Discourse native app."
|
||||||
|
|
||||||
max_prints_per_hour_per_user: "Maximum number of /print page impressions (set to 0 to disable)"
|
max_prints_per_hour_per_user: "Maximum number of /print page impressions (set to 0 to disable)"
|
||||||
|
|
||||||
full_name_required: "Full name is a required field of a user's profile."
|
full_name_required: "Full name is a required field of a user's profile."
|
||||||
|
@ -1260,6 +1260,8 @@ uncategorized:
|
|||||||
|
|
||||||
topic_page_title_includes_category: true
|
topic_page_title_includes_category: true
|
||||||
|
|
||||||
|
native_app_install_banner: false
|
||||||
|
|
||||||
|
|
||||||
user_preferences:
|
user_preferences:
|
||||||
default_email_digest_frequency:
|
default_email_digest_frequency:
|
||||||
|
Reference in New Issue
Block a user