The WrapFast iOS app boilerplate features examples of implementation using SwiftUI of:
Each one is in its proper tab within a Tab Bar.
WrapFast also includes another Tab for a Settings view.
All the keys, links and constant values in the project are retrieved from the Constants.swift
file. You need to replace here:
key
Your RevenueCat API KeypremiumEntitlementIdentifier
the id of your RevenueCat Entitlement(premium by default)termsOfServiceLink
The URL of your Terms of Service.privacyPolicyLink
The URL of your Privacy Policy.WishKit.key
Your WishKit project key if you want to use it.baseURL
The URL to your backend. It must end with a Slash /
authKey
The key to request the secret token to the backend to /auth
endpointappIdentifier
the identifier of your app to handle it in the backendpartialKey
If you are using AIProxy services for the AI Api requests, paste your key here.name
The name you want to appear in the credits sectioncontactEmail
The email to contact supporttwitterUrl
The Twitter/X URL to your profile for the credits sectionfreeCredits
The number of free credits if you want to use a freemium monetization modelappStoreAppId
The id of your app in the App Store. You can check it in App Store ConnectfaqMarkdown
The FAQ text in Markdown. It will be used within a Text View in the FAQView, in Settings.The project is built using the MVVM pattern. Each functionality is separated in a group to keep it neatly organized
The boilerplate includes all the structure and foundation that allows you to create monetizable products rapidly:
WrapFast includes two types of Onboarding Views:
OnboardingFeature(image: Image(systemName: "imageName"),
imageColor: .blue,
title: "Your title",
description: "Your description")
pages
MultiplePagesOnboardingFeatureModel(imageName: "imageName", title: "Your title", description: "Your description")
After the Onboarding, it navigates to the Request Review View.
If you want, skip the request review and navigate directly to LoginView or any other view.
Even that requesting the review without trying the app could feel dumb, evidences have demonstrated that this converts a lot.
Other strategy is requesting review after a success moment. For example in a to-do list app, after completing one ore several tasks. In an AirBnB like app, after booking an apartment successfully and so on.
<aside> 💡 It's important to know that you only have 3 ATTEMPTS PER YEAR to request a review, so place them wisely.
</aside>
<aside>
💡 I also added recently this animated onboarding crAionOnboarding.swift
that I made for one of my apps. If it fits your use case, feel free to use it and tweak regarding your needs 😃
</aside>
crAion’s Onboarding
Showing the Paywall during the onboarding is highly recommended, as it is the comment where users are more willing to pay.
To build the paywall we use RevenueCat as we say in In-App Purchases
Add as many Paywall features as you want with the component:
PaywallFeature(title: "Feature title", description: "Feature description.")
This view is intended to showcase to the user new features or changes between versions.
It compares the current version with the latest one saved, so if it is different or nil, it triggers the sheet showing the view.
In the boilerplate it is triggered from the Vision View, but you can place it wherever you need:
If it is the first version, or you don’t have anything you show across versions, just comment or remove the line calling the function.
This View handle the authentication flow. It injects the AuthManager
to handle the Sign in with Apple logic and the UserManager
to handle the user creation and state.
Sign in flow:
User.swift
) from Firestore. (User data can be whatever you need, it is up to you).WrapFast boilerplate implements several managers and services to interact with different logic along the app. Each aspect of the application's functionality is encapsulated, promoting modularity, reusability, and separation of concerns, which are key principles of software design.
Here's a general definition of the roles each manager play:
AuthManager
: Handles all authentication-related processes. This include signing in, signing out, delete user.FirestoreService
: Manages interactions with Firestore. It abstracts database queries, document reads/writes. In the boilerplate implements examples of how to make CRUD operations for the User information.UserManager
: Handles the state of user’s profile information, authentication state and subscription state. Injects the DatabaseServiceProtocol
to retrieve the user information from Firestore and the PurchasesManager
to handle the subscription state.PurchasesManager
: Handles in-app purchases, subscription management and operations related to RevenueCat. It provides properties and functions to build a custom paywall manually or manually purchase products.AuthBackendService
: Service to request the secret token to the AI BackendAnalyzeMealVisionService
: Service to request a meal analysis to the /vision
endpoint. You can use Anthropic changing the Endpoint requested for Endpoints.anthropicMessages
ChatGPTService
: Service to send a prompt to ChatGPT or Anthropic Messages and request a text response. You can use Anthropic changing the Endpoint requested for Endpoints.anthropicMessages
DALLEService
: Service to send a prompt to DALL·E and request an image response.KeychainManager
: Manages secure storage and retrieval of sensitive information like passwords and tokens using iOS's Keychain services. It implements convenient functions to store free credits to implement a freemium model.