Objective
Some mobile devices are capable of displaying previews for links contained in SMS or MMS messages. When messages that contain a URL are received on these devices, they may be rendered in the messaging application with a preview of the linked page. This behavior is controlled from the phone or its software, and can not be affected by Twilio or the carrier.
The SMS and MMS protocols were created prior to smartphones or mobile internet use becoming common, and specifications for handling URL and link previews were not included. Any changes or differences in how SMS or MMS messages are displayed from device to device are controlled by each device and its software.
Product
Programmable Messaging
Procedure
Link Preview Behavior on iOS
There are multiple factors that affect whether an iPhone (or other iOS device) shows a preview for a link received in a message, and what the preview looks like:
Is the URL at the very beginning or the very end of the message?
iPhones will only display a link preview if the URL is at the beginning or the end of the message. iOS will not render a preview for a URL in the middle of a message, or even just surrounded by periods or quotation marks.
Is there only a single URL in the message, or multiple?
iPhones will only display a link preview if there is one URL in the message. A preview will not be displayed if there are multiple URLs in the same message.
How can I get my URL preview to show up with an image?
iOS will look for OpenGraph metadata on the linked webpage to render a rich preview, when available. See this technical note from Apple for more details on how to implement this.
iMessage vs. SMS
You might notice that messages sent between iPhones may render different previews when the message contains a URL, compared to SMS or MMS sent to that iPhone from Twilio or from a non-iOS device. This is because iOS uses different link preview behavior for iMessages than for standard SMS or MMS.
By default, iPhones use iMessage when sending to other iPhones, instead of SMS or MMS. iMessage is an Apple messaging system which is separate from SMS. iMessage uses your phone number as an identifier, but the messages are not sent using the SMS or MMS protocol.
On an iPhone, you can check whether a specific message thread is using iMessage by looking at the color of your "send message" button, as well as your sent messages. iMessage displays outgoing messages in blue message bubbles, while SMS or MMS are displayed in green.