FIX: only use app argument for official iOS app banner
When showing the native app banner, we include an app argument to automatically add the current site to the official DiscourseHub app. However, the app id can be changed via a hidden site setting, and when changed, that argument is no longer useful. This ensures the argument is only included for the official iOS app banner.
This commit is contained in:
parent
7c741fa0d6
commit
0f67350764
|
@ -338,6 +338,12 @@ module ApplicationHelper
|
|||
current_user && current_user.trust_level >= 1 && SiteSetting.native_app_install_banner_ios
|
||||
end
|
||||
|
||||
def ios_app_argument
|
||||
# argument only makes sense for DiscourseHub app
|
||||
SiteSetting.ios_app_id == "1173672076" ?
|
||||
", app-argument=discourse://new?siteUrl=#{Discourse.base_url}" : ""
|
||||
end
|
||||
|
||||
def allow_plugins?
|
||||
!request.env[ApplicationController::NO_PLUGINS]
|
||||
end
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<link rel="manifest" href="<%= Discourse.base_uri %>/manifest.webmanifest" crossorigin="use-credentials">
|
||||
|
||||
<%- if include_ios_native_app_banner? %>
|
||||
<meta name="apple-itunes-app" content="app-id=<%= SiteSetting.ios_app_id %>, app-argument=discourse://new?siteUrl=<%= Discourse.base_url %>">
|
||||
<meta name="apple-itunes-app" content="app-id=<%= SiteSetting.ios_app_id %><%= ios_app_argument %>">
|
||||
<%- end %>
|
||||
|
||||
<%= render partial: "common/discourse_stylesheet" %>
|
||||
|
|
Loading…
Reference in New Issue