So You Want To Sell Your App Outside the Mac App Store …

Writing your own app store and licensor is a rite of passage.
—Wil Shipley

I wrote this book to save you a ton of work. Depending on your experience level, this book might save you days or weeks if you had to start from scratch and research, implement, and test everything on your own. I know because it took me ages to get confident in the process back in 2013 when I figured things out for my first commercial macOS app, WordCounter. It was a lot of extra work I’d rather have skipped for my first commercial product. I can still remember my high levels of anxiety when I started to implement the parts that make an app purchase-able. It’s very embarrassing if things go wrong, especially when it comes to other people’s money. Understandably, people get angry when their credit card is charged and they don’t receive a working product in return. So I wanted to make sure that absolutely nothing could go wrong. How-to’s on the intricacies are few and far between. In this book, you’ll learn everything to turn your app into a product that can be sold.

With the Mac App Store, you only have to provide a working binary, upload it, pass the review, and that’s it. You can focus on the features you want, no need to worry about the infrastructure. That sounds like a compelling argument at first since it removes much of the perceived burden, but you’ll see that the things you learn from this book aren’t complicated at all. They’re just not talked about a lot and thus result in a lot of wasted time fiddling around. This book fixes that problem for you.

Remember the decision to sell outside the Mac App Store does not prevent you from selling inside the Mac App Store. It could make sense to ditch the App Store completely, but it can also make sense to try to reach different audiences via different platforms in parallel.

I’m all for empowering developers to achieve their goals. The Mac App Store might hinder you on your way; here’s a short rundown of things you should consider when you figure out how you want to sell your app so we’re both on the same page:

  • Can you pull of your own marketing? The App Store may be an uninspiring warehouse, but it’s a warehouse your old aunt might learn to operate and find stuff in. The discoverability on the App Store might be minuscule without any marketing, but its greater than 0.
  • Can your app be Sandboxed easily? If not, the App Store won’t be viable.
  • Do you want to participate in bundle sales? App Store doesn’t do that.
  • Do you want to provide education or bulk discounts?
  • Does your business target other businesses, and do you regularly need to provide non-personalized bulk licenses? If so, you will want the flexibility of an e-commerce provider like FastSpring.
  • Do you want to experiment with business models like cross-platform subscriptions? Might be way easier to pull off on your own.
  • Do you want to make piracy of your app harder, for example by validating how many machine someone can run your app on? Then you will want to activate apps via your own servers.
  • Will your business suffer if Apple pulls your app from the Store, even if by mistake? It’s a numbers game: a sufficiently large corporation like Apple will eventually make mistakes. PayPal and amazon are known for closing accounts a bit too proactively. Maybe you remember the incident when the popular API documentation app Dash was pulled from the App Store and its dev was very happy to have another way to sell his app. I strongly advise you set up a safety net to make your business less fragile.
  • Do you want to cut cost? FastSpring has a flat fee of 8.9% per transaction, as opposed to Apple’s 30% cut after deducting value-added tax (VAT). Say you sell an app for €9.99 to a German customer. After a 19% VAT reduction of €1.90, Apple takes 30% of the remaining €8.09 and you’ll earn a depressing €5.66 – whereas the same app sold via FastSpring would leave you with €8.14.

The folks of MacPaw and later Setapp conduct regular surveys about the state of the Mac developer happiness you might want to check out if you want to know more about the obstacles developers face.1

As of this edition’s release, I am selling four macOS apps with the techniques outlined in this book, one of them also available on the Mac App Store, and I helped clients set up their apps for sale on FastSpring, too. Meanwhile, this book goes beyond the mere personal preference of yours truly and will teach you the implicit industry standards of selling outside the App Store I discovered from interviews with senior independent Mac developers.

Goal of this Book

You’ll learn everything you need to run your own app store. You’ll be pretty much set up to sell you software immediately: a web presence is all you need in addition.

The ultimate goal of this book is to get all the obstacles out of your way so you can start using FastSpring in your app today. Depending on your reading speed, you can start this book in the morning and have working license verification implemented by the end of the day. All you need is in this book.

Why FastSpring?

FastSpring isn’t the only service on the market to sell apps. You have lots of options to handle digital purchases nowadays, depending on what you need. Opposed to simpler approaches involving PayPal, Stripe, or gumroad, FastSpring does offer much more flexibility. You can generate license codes to protect your app, and if you want to add in-app purchases or subscriptions, you can interact with their API to retrieve customer information. All the while, they handle value-added tax (VAT) for you and have a low flat service fee of 8.9% per purchase. Their service is comfortable to use and powerful at the same time.

In 2013, I picked FastSpring to sell my apps, mostly because of social proof. Lots of indie teams I respected were using FastSpring since before the Mac App Store even existed. I asked around, gave it a spin and immediately liked how things worked.2 And I still love their service. I bet you’ll like them as well.

What You’ll Learn

From a technical perspective, you’ll learn how to perform the following tasks:

  • Set up a product for sale with FastSpring, including license code generation and sending order confirmation e-mails with activation links.
  • Guard your app against software piracy to some extent, requiring license code and name to let users pass.
  • Add a time-based trial to your application. You can copy this code right into your existing app.
  • Implement an activation handler in your app which verifies the license information before unlocking the app. This, too, can be copied right into your existing app.

I’ll show you all these things in detail so you can be certain that everything is taken care of:

  • how to set up FastSpring as the store where people buy your software,
  • add automatic license key generation to the checkout process,
  • implement license code verification in your app,
  • create a time-based trial,
  • offer in-app purchases,
  • set up app updates,
  • and how to figure out a price and prepare the release.

Optionally, you can even learn how to handle in-app purchases or offer a store front from right within your application using FastSpring’s Embedded Store SDK in the appendix.

All in all, you only have to take the sample code of this book and copy the parts you want to use into your own project to get started. If your app is already functional, it may take you no more than an hour or two to put your app under copy protection and add a time-based trial – depending on your existing code, of course.

The sample code will be written in the latest stable version of Swift. I’ll update the book regularly, so check back for a new e-book version download when you notice Swift has changed.

Structure of the Book

The process I’ll show you isn’t complicated, but I separated the implementation into multiple steps so you can learn how to scale everything. Here’s a quick synopsis of the upcoming chapters.

“Copy Protection with License Codes” establishes a few technical terms used throughout this book and prepares you for the implementation ahead.

Set Up Your App for Sale on FastSpring is about getting comfortable with FastSpring. You’ll set up your web store and add your product in such a way that people could start buying it. Having this part of the process ready helps when you test if the application code does its job.

The implementation in your app is split up in two parts explained in the next two chapters, so you can take whatever you need and leave the rest. They are very practical and there’s an accompanying example app for each chapter for quick reference.

Sample App 1 will teach you how to add the code for app activation. When you have done this, you can verify that the FastSpring code generator works as expected. You can upload the resulting app for sale already, but people would have to buy a license up front, much like paid-up-front downloads in the App Store. But that’s not very attractive, so …

Sample App 2 will show the process of implementing a time-based trial mode in your application to enable users to test-drive your app for a while. This chapter is technical, and we’ll discuss different trial options. The trial mode is purely your app’s responsibility and will not affect your setup with FastSpring.

The Appendix is a collection of self-contained sections that explain how to implement optional and advanced features.