Features
Configurations
Configurations Documentation
The ShipThatApp
SwiftUI boilerplate comes with several pre-configured services and functionality that assist in setting up analytics, in-app purchases, and authentication. These configurations are critical for the app to work correctly and to ensure that developers have full access to modify and adapt these services based on their project needs.
TelemetryDeck (Analytics)
TelemetryDeck is an analytics service used to track user behavior and app performance. It is important to configure this service with the correct APP ID to gather analytics.
TD Configuration Details
Find the App ID from your TelemetryDeck account.
Insert the App ID into the
Info.plist
file under the keyTD_APP_ID
.Initialize the Telemetry manager with the configuration in
ShipThatAppApp.swift
:private func configureTelemetry() { guard let telemetryDeckAppID = Bundle.main.infoDictionary?["TD_APP_ID"] as? String else { return } let configuration = TelemetryManagerConfiguration(appID: telemetryDeckAppID) TelemetryManager.initialize(with: configuration) }
Call the
configureTelemetry
function within theinit()
ofShipThatAppApp
.
RevenueCat (In-App Purchases)
RevenueCat is a service that helps you manage in-app purchases and subscriptions. Setting up RevenueCat correctly is vital for the monetization aspect of the app.
RC Configuration Details:
Obtain the API Key from your RevenueCat dashboard.
Add the API Key to the
Info.plist
file under the keyRC_API_KEY
.Set up RevenueCat in
ShipThatAppApp.swift
:private func configureRevenueCat() { guard let revenueCatApiString = Bundle.main.infoDictionary?["RC_API_KEY"] as? String else { return } Purchases.logLevel = .debug Purchases.configure(withAPIKey: revenueCatApiString) }
Call the
configureRevenueCat
function within theinit()
ofShipThatAppApp
.
Authentication (Supabase)
Authentication using Supabase allows for various methods such as email/password, magic link, and social providers like Sign in with Apple.
SB Configuration Details:
Set up your Supabase instance and obtain the URL and Annon Key.
Configure the auth client in
AuthManager.swift
:let client = SupabaseClient(supabaseURL: URL(string: "https://your-instance.supabase.co")!, supabaseKey: "your-supabase-annon-key")
Replace the placeholders with your actual Supabase URL and Annon Key.
Utilize
AuthManager
throughout the app for handling authentication flows.
Custom URL Scheme (for Magic Link)
iOS requires a custom URL scheme to handle incoming magic links for passwordless authentication.
Magic Link Configuration Details
Register a URL scheme for your app in the
Info.plist
:<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>shipthatapp</string> </array> </dict> </array>
Replace
shipthatapp
with your custom scheme.Implement the URL handling in
ShipThatAppApp.swift
to redirect to the auth flow when a magic link is accessed.
Splash Screen Delay
To configure the duration of the splash screen display:
SC Configuration Details
Set up a custom delay duration in
ShipThatAppApp.swift
:private func dismissSplashScreenAfterDelay() async { try? await Task.sleep(for: .seconds(1)) // Set your desired time here splashScreenState.dismiss() }
Adjust the seconds to the desired splash screen duration.
These configurations are essential to make ShipThatApp
work out-of-the-box. Ensure that all the services are set up correctly and the placeholders are replaced with your actual project details. By following these configuration steps, you can customize ShipThatApp
to fit the needs of your specific application.