FEATURE: Opt-in native Discourse app install banner on Android/iOS

This commit is contained in:
Rafael dos Santos Silva
2017-01-03 15:50:45 -02:00
parent d8be3e8bb1
commit d7c8c2d5e3
4 changed files with 23 additions and 1 deletions

View File

@ -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