mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 00:58:18 +00:00
Prefer native apps over PWA (#27254)
This commit is contained in:
parent
4238da6ee3
commit
0c16365991
|
@ -8,7 +8,8 @@ class ManifestSerializer < ActiveModel::Serializer
|
|||
attributes :id, :name, :short_name,
|
||||
:icons, :theme_color, :background_color,
|
||||
:display, :start_url, :scope,
|
||||
:share_target, :shortcuts
|
||||
:share_target, :shortcuts,
|
||||
:prefer_related_applications, :related_applications
|
||||
|
||||
def id
|
||||
# This is set to `/home` because that was the old value of `start_url` and
|
||||
|
@ -89,4 +90,28 @@ class ManifestSerializer < ActiveModel::Serializer
|
|||
},
|
||||
]
|
||||
end
|
||||
|
||||
def prefer_related_applications
|
||||
true
|
||||
end
|
||||
|
||||
def related_applications
|
||||
[
|
||||
{
|
||||
platform: 'play',
|
||||
url: 'https://play.google.com/store/apps/details?id=org.joinmastodon.android',
|
||||
id: 'org.joinmastodon.android',
|
||||
},
|
||||
{
|
||||
platform: 'itunes',
|
||||
url: 'https://apps.apple.com/us/app/mastodon-for-iphone/id1571998974',
|
||||
id: 'id1571998974',
|
||||
},
|
||||
{
|
||||
platform: 'f-droid',
|
||||
url: 'https://f-droid.org/en/packages/org.joinmastodon.android/',
|
||||
id: 'org.joinmastodon.android',
|
||||
},
|
||||
]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue