Adding Smart App Banner for insporation on iOS devices
This commit is contained in:
parent
2fe5a7bd40
commit
83a2274f47
3 changed files with 39 additions and 0 deletions
|
|
@ -13,6 +13,14 @@ module ApplicationHelper
|
||||||
AppConfig.version.number
|
AppConfig.version.number
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def uri_with_username
|
||||||
|
if user_signed_in?
|
||||||
|
AppConfig.pod_uri + "?username=#{current_user.username}"
|
||||||
|
else
|
||||||
|
AppConfig.pod_uri
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def changelog_url
|
def changelog_url
|
||||||
return AppConfig.settings.changelog_url.get if AppConfig.settings.changelog_url.present?
|
return AppConfig.settings.changelog_url.get if AppConfig.settings.changelog_url.present?
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
%html{lang: I18n.locale.to_s, dir: (rtl? ? "rtl" : "ltr")}
|
%html{lang: I18n.locale.to_s, dir: (rtl? ? "rtl" : "ltr")}
|
||||||
%head{prefix: og_prefix}
|
%head{prefix: og_prefix}
|
||||||
%meta{name: "viewport", content: "width=device-width, initial-scale=1"}/
|
%meta{name: "viewport", content: "width=device-width, initial-scale=1"}/
|
||||||
|
%meta{name: "apple-itunes-app", content: "app-id=1538074832, app-argument=#{uri_with_username}"}
|
||||||
|
|
||||||
- content_for :javascript do
|
- content_for :javascript do
|
||||||
= javascript_include_tag :main
|
= javascript_include_tag :main
|
||||||
|
|
|
||||||
|
|
@ -165,4 +165,34 @@ describe ApplicationHelper, :type => :helper do
|
||||||
expect(pod_version).to match "0.0.1.0"
|
expect(pod_version).to match "0.0.1.0"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#uri_with_username" do
|
||||||
|
attr_reader :current_user
|
||||||
|
|
||||||
|
before do
|
||||||
|
@current_user = alice
|
||||||
|
def user_signed_in?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it "displays the pod uri and username if logged in" do
|
||||||
|
allow(AppConfig).to receive(:pod_uri) { "https://diaspora.social" }
|
||||||
|
expect(uri_with_username).to match "https://diaspora.social?username=alice"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "#uri_with_username without logged in user" do
|
||||||
|
before do
|
||||||
|
@current_user = alice
|
||||||
|
def user_signed_in?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it "displays the pod uri" do
|
||||||
|
allow(AppConfig).to receive(:pod_uri) { "https://diaspora.social" }
|
||||||
|
expect(uri_with_username).to match "https://diaspora.social"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue