WrapFast Documentation

Get Started

In-App Purchases

Firebase

WishKit

AI Backend

Xcode Project

API Client

Support

Configuring App Store Connect

WrapFast comes with a preconfigured purchases flow of 3 products. In order to get this functional, you need to create them on App Store Connect.

For being able to do this, you need to have created an app.

Creating an app

You can create an app mannualy in the App Store Connect clicking on the + Button. The app Bundle Identifier may be already created by Xcode with the prefix XC, otherwise you will have to create it manually.

Untitled

Since Xcode 15, you can create automatically an app directly to App Store Connect. To achieve this, in Xcode:

Untitled

Untitled

<aside> ⚠️ If you receive a mail with this: ITMS-90078: Missing Push Notification Entitlement, just ignore it. It is a known bug from Apple side that may occur when using Firebase in your project. I won’t affect you at all.

</aside>

<aside> 💡 Do you want to learn ASO basics? This FREE book by Matteo Spada, creator of Astro ASO tool is the best way to learn the basics FAST: https://matteospada.gumroad.com/l/dzgmq

</aside>

Creating Products: Subscriptions and One Time Purchases

In App Store Connect, enter in your new app created. You are going to configure the products that will be purchased from your app.

In the left menu:

Screenshot 2024-02-07 at 11.56.51.png

<aside> ⚠️ If you are building a GPT Wrapper, uncheck the country China Mainland. Apple will reject it as it is forbidden these type of apps by Chinese laws.

</aside>

Now do the same for Subscriptions. You can find them in the left menu:

CleanShot 2024-09-16 at 21.31.37@2x.png

Untitled

<aside> ⚠️ Family Sharing is turned off by default. Mind that if you turn it on, you cannot set it off later. You’ll have to create a complete new product. Apple things… ¯\*(ツ)*/¯

Screenshot 2024-02-07 at 12.02.45.png

</aside>

<aside> ⚠️ Don’t care so far about the Missing Metadata warning. Later on, before submitting your app to review, remember to upload a screenshot of every in-app purchase, like this:

Untitled

</aside>

Creating a Shared Secret

We need to create a token called Shared Secret to set it later in the RevenueCat Dashboard. To do so, in App Store Connect:

Untitled

Generating In-App Purchase Key

In order to allow RevenueCat communicate with StoreKit API, we need to generate a key. Todo so, in the App Store Connect do this:

Untitled

Untitled

Untitled

RevenueCat 😺

WrapFast relies on the best existing framework to handle in-app purchases and subscriptions in the easiest and quickest way.

RevenueCat Documentation here

The WrapFast boilerplate comes out of the box with the following pre-configured example offering:

This means when you fetch the default Offering within the app, you get those Packages and you can display the Paywall associated to it.

When an user purchases one of the Products, he is granted with the Entitlement associated to that product. Therefore you can easily check if the user has an Entitlement active to display or not the Premium features within your app.

This logic comes already implemented in the WrapFast boilerplate and it is handled by this two managers:

PurchasesManager: Handles all the interactions with RevenueCat.

UserManager: Handles user’s state. In terms of purchases, isSubscriptionActive is the property used in the project to check whether to display premium features or not.

In order to get this functional, you need to sign up for free in RevenueCat and create a new project.

We will go through it in the following sections.

Adding an App Store app in RevenueCat

Generating an API Key

Go to the Api Keys menu on the left and next to your App Name click Show Api Key. Copy it in a safe place, you will need it later to paste in the Xcode project.

<aside> 💡 You will have to paste the RevenueCat API key in Xcode in Const.Purchases.key within Constants.swift

</aside>

Creating Products

We need to add here the same products that we created in the App Store Connect.