Merge pull request #4632 from xfalcox/native-app-banner
FEATURE: Opt-in native Discourse app install banner
This commit is contained in:
commit
d3fb724578
|
@ -13,7 +13,7 @@ class MetadataController < ApplicationController
|
|||
private
|
||||
|
||||
def default_manifest
|
||||
{
|
||||
manifest = {
|
||||
name: SiteSetting.title,
|
||||
short_name: SiteSetting.title,
|
||||
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
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
<%= render_google_universal_analytics_code %>
|
||||
<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 %>
|
||||
</head>
|
||||
|
||||
|
|
|
@ -1367,6 +1367,8 @@ en:
|
|||
|
||||
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)"
|
||||
|
||||
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
|
||||
|
||||
native_app_install_banner: false
|
||||
|
||||
|
||||
user_preferences:
|
||||
default_email_digest_frequency:
|
||||
|
|
Loading…
Reference in New Issue