BT

Apple Opens the Messages Framework to Developers

| by Sergio De Simone Follow 18 Followers on Jun 19, 2016. Estimated reading time: 1 minute |

Apple’s new Messages framework for iOS, introduced at WWDC 2016, aims to make it possible to create app extensions that interact with Apple’s Messages app. The new Messages API enable two kinds of extensions:

  • Sticker packs, which provide a collection of images users can include in their messages.
  • iMessage apps, which provide access to external apps from within Messages.

Sticker apps do no require any coding and can be created by simply copying image files into a project template provided by Xcode. By contrast, iMessage apps can use the full Messages framework, as explained below. According to Apple, iMessage apps will make it possible to share content, send payments, play games, collaborate, and more, directly from Messages.

The Messages framework includes a number of basic classes that developers can use:

  • MSMessageAppViewController: this class provides the main view controller for Messages extensions. It allows to present a custom user interface, manage the extension’s state, get the current conversation, track message sending, etc.

  • MSStickerBrowserViewController, MSStickerBrowserView, and MSStickerBrowserViewDataSource: these classes are meant to customize and present a custom or dynamic sticker browser. If you want to provide dynamic content for your sticker browser, you can implement a custom MSStickerBrowserViewDataSource. If you want to customize the appearance of the default sticker browser, you can provide your own MSStickerBrowserView and customize the browser’s size, the size of the stickers, etc. Further customization is possible by subclassing MSStickerView.

  • MSConversation: this class represents a conversation and allows to send text, stickers, attachments, or message objects by inserting them into a message’s input field.

  • MSMessage: this class allows to create interactive messages and access message properties, such as its sender, the session that the message belongs to, an optional URL associated with it, etc.

  • MSSession: this class allows to identify messages so they can be later updated, for example, in a game or collaborative app.

The Messages framework is available with Xcode 8 beta, which can be freely downloaded by registered developers.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Are iMessages always meant to be composed/read by users? by Igor Kolomiets

I wonder if I can use iMessage as point-to-point transport for application's protocol messages.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT