Technical Note TN2444

Best Practices for Link Previews in Messages

Messages in iOS and macOS will automatically generate inline previews for links people send. By default these render as gray bubbles showing the page title, domain, and small icon. By adding a small amount of Open Graph metadata on your website pages, you can make these iMessage link previews look great by displaying images and meaningful captions.

Introduction
Enabling Link Previews
Document Revision History

Introduction

When people send messages containing links to web sites, Messages in iOS and macOS will automatically generate inline previews for the links. These previews rely on metadata from the page referenced by the link. If no metadata can be found, a generic link preview is generated as shown in Figure 1.

Figure 1  Default link preview for http://www.example.com.

However, by adding a small amount of Open Graph metadata on your pages you can enable a much richer link preview as shown in Figure 2.

Figure 2  Link preview for http://www.apple.com/iphone includes metadata for an image and title.

This is accomplished by including the following meta tags on the webpage:

Listing 1  Open Graph meta tags included on http://www.apple.com/iphone.

<meta property="og:title" content="iPhone" />
<meta property="og:image" content="https://www.apple.com/v/iphone/home/t/images/home/og.png?201610171354" />

Enabling Link Previews

Below are additional tips on how to get great looking link previews in Messages.

Consistent metadata for all user agents

Images in link previews

Videos in link previews

Titles in link previews

Reachability

Limits

Other Resources



Document Revision History


DateNotes
2017-09-08

New document that explains how website developer can add metadata in order to get better link previews in Messages for iOS and macOS.