Skip to content

Link previews from Mastodon should show more info with Apple link view #20569

Closed
@jaanus

Description

@jaanus

Steps to reproduce the problem

  1. Share a link to a post on Mastodon in some system which uses Apple’s LPLinkView to render link previews
  2. 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:

mastodon post preview

As comparison, link preview for a tweet like https://twitter.com/joinmastodon/status/1591089671794462720 looks like this, which is much more useful:

twitter preview

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:

mastodon in debugger

And here is the same for the Twitter post:

twitter in debugger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions