Chapter 34
Building a Simple Sticker App

Back in 2016, the introduction of the Message framework in iOS 10 was one of the biggest announcements. Developers can finally create app extensions for Apple's built-in Messages app. By building an app extension, you let users interact with your app right in the Messages app. For example, you can build a message sticker extension that allows your users to send stickers while communicating with his/her friends in Messages. Or if you already developed a photo editing app, you can now write an extension for users to edit photos without leaving the Messages app.

The support of extension opens up a lot of opportunities for app developers. Apple even introduced a separate App Store for iMessage. You can sell stickers and app extensions through the app store, which is dedicated for iMessage.

To build an app extension for Messages, you will need to make use of the new Message framework. The framework supports two types of app extensions:

  • Sticker packs
  • iMessage apps

In this chapter, I will focus on showing you how to build a sticker pack. For the chapter that follows, we will dive a little bit deeper to see how you can develop an iMessage app.

Before moving on, I have to say that Apple makes it very easy for everyone to build sticker packs. Even if you do not have any Swift programming experience, you'll be able to create your own sticker pack because it doesn't need you to write a line of code. Follow the procedures described in this chapter and learn how to create a sticker extension.

Preparing the Sticker Images

Creating a sticker app is a two-part process:

  • First, you prepare the sticker images, that conforms to Apple's requirements.
  • Secondly, you create a sticker app project using Xcode.

Let's start with the first part. Messages supports various sticker image formats including PNG, GIF, and JPG, with a maximum size of 500KB. That said, it is recommended to use images in PNG format.

Sticker images are displayed in a grid-based browser. Depending on the image size (small, regular or large), the browser presents the images in 2, 3 or 4 columns.

Figure 34.1. How the image size affects the sticker presentation
Figure 34.1. How the image size affects the sticker presentation

Other than size, the other thing you have to consider, while preparing your sticker images, is whether the images are static or animated. Messages supports both. For animated images, they should be either in GIF or APNG format.

We will discuss more on animated sticker images in the later section. So let's focus on the static ones first. Now choose your own images and resize them to a size that best fits your stickers.

To continue reading and access the full version of the book, please get the full copy here. You will also be able to access the full source code of the project.

results matching ""

    No results matching ""