CartoonSmart’s Sticker Kit will enable you to sell In-App Purchase-able stickers without writing any code. This Swift-based Xcode project essentially only requires you to import your stickers, define two simple properties about each sticker (filename / whether or not it’s free) then enter your app’s In-App Purchase Product ID. Yes, its that simple.
Properties for Each Sticker
Like all of our kits, the Sticker Kit can be customized through a Property List. Sticker Packs themselves are pretty simple, so the Property List has relatively few properties compared to our other kits. What you see in the screenshot to the right are the only properties. And most can be left as is.
Highlighted in the screenshot are the main 2 properties, you’ll set over and over again when adding new stickers to the kit. Details on each are below…
- PNG – is the name of the still or Animated PNG file you’ve imported to the kit. We recommend using PNG Animator to make your animated PNG files. Its a very cheap program available in the Mac App Store. Do NOT include the .png extension, only include the file name. Spaces are okay, and actually encouraged. When you name your sticker files try to write a short two or three word description of them. The kit will use the file name as the accessibility description for the sticker (if your user is blind or has trouble seeing, this can help them immensely). It takes no extra work to make your app more accessible.
- Free – a true or false value. If true, the sticker is useable for free. If false, the sticker requires an In-App purchase.
For every sticker your pack will have, you’ll copy and paste a new item in the StickerList array, and simply define the name and whether or not it is free. You can have an unlimited number of stickers.
In App Purchasing Properties
To enable in-app purchasing of your non-free stickers, you’ll first need to go into iTunes Connect and create a new Non-Consumable Product. Note the Product ID.
- ID – this value will be the same Product ID you entered
- TestInPaidMode – a YES or NO value. If YES, you are in Test mode. You can run the app in the Simulator or on your device and it will be the same as if the In-App Purchase was already made. This is a quick way of testing your paid version without actually have to do a Sandbox purchase. After building in test mode, delete the app and switch this value back to NO before submitting to Apple, or testing a Sandbox purchase.
- PurchaseText – a short string value to prompt people to purchase the locked stickers. For example, “Unlock Every Sticker for $1”. This text will appear on the button to purchase
- PurchaseText2 – an optional secondary short string value to encourage people to buy. For example, “Tap here to buy”. This swap out in place of the PurchaseText every few seconds. Delete this property or make it identical to the PurchaseText value if you don’t use it.
- PurchaseText3 – one more optional line of text. Again, this will repetitively cycle through with the other lines of text. Delete this property or make it identical to the PurchaseText value if you don’t use it.
The Restore button is hard-coded with the “Restore” text. You can change this in the code if need be (not recommended).
Button Appearance Properties
You can make some minor style changes to the Purchase and Restore button using the property list.
- Font – the font for the button text. This is the common name of the font, as it reads in an app like Font Book. If you want to include a custom font, you will also need to import the .ttf file. You can locate any font’s source file by right-clicking on it in Font Book and choosing Show in Finder. In Xcode go to the Info.plist file (a different property list file included in every Xcode project). Unfold Fonts Provided by Application, then list the font file name. This value will include the .ttf extension. In the kit’s Xcode project, we’ve included an example of how you’ll do this using the Arial font. You can delete the Arial.ttf as thats a standard font anyway.
- BuyButtonWider – a YES or NO value to make the button 2/3 the size of the screen or half. Typically this looks better on all devices set to YES
- ExtraVerticalSpacing – default is 30, use this to adjust the vertical location
- ButtonAlpha – the alpha value of the background color of the button. by default this is 0 (invisible). The max value is 1.
- Red – a range of 0 to 1 for the red value of the background color.
- Green – a range of 0 to 1 for the green value of the background color.
- Blue – a range of 0 to 1 for the blue value of the background color.
- Deceleration – a decimal value to slow or speed up how quickly users can scroll down the stickers.
- StopOffScreenAnimations – a YES or NO value to stop animations when they go offscreen. Hopefully Apple already has this baked into the World of Stickers, but we’ve added this option anyway.
- Background – the name of a PNG file to act as a pattern for the background (do not include the @2x.png extension). A file named Pattern@2x.png is already included. You can also enter a value of Black or White to make the background pure black or white.
- TransactionID – Enter a valid transaction from your purchase