Description
Steps to reproduce the problem
- Share a link to a post on Mastodon in some system which uses Apple’s
LPLinkView
to render link previews - Observe the preview that gets rendered
Expected behaviour
The link preview should have the post content
Actual behaviour
Link preview only shows avatar of author
Detailed description
(This issue may well affect also other systems that render previews of web links. I limit my discussion only to Apple LPLinkView because that’s what I’m familiar with.)
Link previews of Mastodon posts aren’t useful. They only show a large avatar of the author, and nothing about the post itself. Here is an example.
Link preview for https://mastodon.social/@Gargron/109300299959535882
rendered with LPLinkView
looks like this:
As comparison, link preview for a tweet like https://twitter.com/joinmastodon/status/1591089671794462720
looks like this, which is much more useful:
Apple does not disclose how exactly they generate the previews. They definitely crawl the URL, and the preview is probably some combination of OpenGraph content, HTML metadata, and content parsing.
Link previews are powered by the LPLinkMetadata
. I give a URL to LPMetadataProvider
which fetches the link for me and generates the metadata object.
I can inspect the metadata objects in debugger. Here is what the data looks like for the Mastodon post:
And here is the same for the Twitter post:
You see that the link metadata for the Mastodon post actually contains the Mastodon post content, but for whatever reason, the Apple LPLinkView decides not to render it, and only shows me the author’s avatar.
I am not sure how other link preview renderers behave with Mastodon posts. Maybe it’s only an Apple quirk. Nevertheless, there are quite a few Apple users out there, and many apps use the system-provided link previews. It would be nice to provide more informative previews for Mastodon posts.
Specifications
Mastodon server version on mastodon.social that was used to fetch the post: v4.0.0rc3