iMessage Stickers are a very fun and engaging way for illustrators, developers, and just regular people to promote and engage users to their App. They can be built as a separate App or as a part of your main App.
Creating a Standalone App
We will first start out by creating a separate standalone App, add later add it to an existing App. To start, create a new Xcode project, and start with the Sticker Pack App template. Give it a name that fits, and place the project file where you would like it.
Now drag and drop your images into the Stickers.xcstickers folder. The best images work as transparent PNG images. Then build and run your App. Your images should now come up. And that’s it, pretty simple right?
Your App icon is white because we have not yet assigned an image for the logo. To do that just go to iMessage App Icon and drag your logo in. There are many sizes to have, but make sure the image is 2 times 60×45 so it must be 120×90 then you would do the same for 3x so it would be 180×135. The images use multiple sizes because there are multiple screen resolutions of devices.
Swift Tip – Place the multiple of the resolution in the file name. Doing this Xcode will automatically place the files in their corresponding resolution when dragging multiple. You can do this by adding @2x or @3x to the beginning of the file name.
Adding to an Existing App
Many already have an App or game that they created and would like to add it. As it turns out adding Stickers to an existing App is easier than you might think. Apple has already created a template that we can use. The template we are using is called an App Extension.
What is an iOS App Extension?
App Extensions allow your App to extend beyond your App and into the system wide settings of the users device. They allow you to access the today widget page, create custom share options, change the users keyboard and of course allow us to combine our sticker App with our game or App.
Swift Fact – Extensions were first introduced in iOS 8. The main ones they first started with was the Today, Share, Action, Photo Editing, Document Provider, and custom keyboard. And in iOS 10 released the stickers and iMessage extension.
To combine the apps we will go to File > New > Target > Sticker Pack App. Then give it a name, and in the prompt that comes up click Activate.
What is a iOS Target?
We just created a new target, but what is it? An Xcode Target allows you to separate and divide projects into more than one sections. It gives developers the ability to debug, test and build faster. You can also have a target to separate the tasks at hand, so if you wanted to debug the App it could be in a different target. Allowing you to have custom classes and functions you wouldn’t put in a production App. In our case, we are using a target to combine the two projects into one project, but because it is a target we can also run it separately.
Finishing Up
Finally, all we have to do is add the images as we did before. Just drag the correct images and logos into the Stickers.xcstickers folder that was created when we added the target.
Great job! We have learned about iOS Targets, and Extensions, all while creating a fun sticker App.