In-App Purchases setup

Guide for settings up your In-App Purchases


In-App Purchases is a core feature that will make you money after all. We're gonna set it all up in this guide.

1. RevenueCat setup

In-App Purchases in SwiftSail are handled by RevenueCat. It's a third party service with a generous free plan which you can use to handle all cases when it comes to subscriptions or in-app purchases. Without that, we would have to handle renewals, cancellations, billing failures,... ourselves.

  1. Create an account [here] (https://app.revenuecat.com/signup)
  2. Add new AppStore app (follow RevenueCat instructions to finish this step)
  3. Get an API key for your project
  4. Paste the API key to Constants.swift file

You can find the comprehensive guide here or reach out to me on Twitter if you need any help!

2. AppStoreConnect Products setup

Before working with RevenueCat, you have to create your products in AppStoreConnect.

RevenueCat offers a comprehensive guide on how to setup your AppStoreConnect products here.

Important: One thing I found out is that if you create your subscription products within the same subscription group, the users can easily switch between the subscriptions. This is not an issue in the normal circumstances. But if you plan to create some kind of one-time special offer with 50% on annual subscription, the users will be able to see this offer even if they are not eligible for it. Simply open Settings app on your iPhone -> click on your iCloud account name -> Subscriptions -> open any subscription you see there.

On the screenshot below you can see that I offered a special discount for 1 year subscription for Trading Tracker only to a certain group of users. However, all users can easily switch to this subscription if they know about this feature of iOS. Subscripgion groups

To avoid this situation, you can create a separate subscription group and add your special offer there. Users cannot switch between two subscription groups. However, if they already have a subscription in one subscription group, by purchasing a subscription from the second group they will have two parallel subscriptions at the same time.

3. RevenueCat Products setup

Setting up the products you want to sell is essential. I would strongly suggest to go over RevenueCat guide to create the products as it's a bit more complex topic and they covered it better than I would :).

⚠️ IMPORTANT (entitlements): when choosing the names for your entitlement in RevenueCat, make sure to enter pro name or create your own and replace the entitlement name in Xcode project.

⚠️ IMPORTANT (offerings): when choosing the names for your offering in RevenueCat, make sure to enter default name or create your own and replace the default offering name in Xcode project.

Remember, if you need any help, feel free to reach out on Twitter!