Skip to main content
Find complete deployment steps in your project Building Your App

OpenRouter Setup

Before deploying, you need to set up the AI proxy through Supabase Edge Functions. This keeps your API keys secure on the server.
Never bundle API keys in your iOS app. Keys can be extracted from the binary. Our architecture routes all AI requests through Supabase Edge Functions.
1

Step 5: Generate OpenRouter API Key

Sign up or sign in to OpenRouter:
  1. Create your first project
  2. Generate your API key
This is a private key. We will deploy it directly to our Supabase Edge Function and never bundle it with our app or push it to git.
2

Step 8: Set OpenRouter Key as Supabase Secret

Set your OpenRouter key as a Supabase secret:
supabase secrets set OPENROUTER_API_KEY=sk-or-your-openrouter-key
This keeps your API key secure on the server side.
3

Step 9: Deploy AI Edge Function

Deploy the AI Edge Function to Supabase:
supabase functions deploy ai
The boilerplate includes a ready-to-deploy Edge Function that handles all AI API calls securely.
4

Step 10: Verify Deployment

Verify your function is deployed:
  1. Go to Supabase DashboardEdge Functions
  2. See your ai function listed
  3. Note down the function URL
5

Step 11: Update PROXY_BASEURL

Open Config/Secrets.xcconfig in Xcode and update:
PROXY_BASEURL = https://your-project.supabase.co/functions/v1/ai
Then run the update script:
bash scripts/update-config.sh

Deployment Phases

1

Pre-Deployment

  • Run full test suite
  • Fix all linter warnings
  • Test on real devices
  • Update legal documents
2

TestFlight Beta

  • Archive build
  • Upload to App Store Connect
  • Add internal testers
  • Gather feedback
3

App Store Submission

  • Prepare metadata
  • Create screenshots
  • Submit for review
  • Monitor status
4

Production Launch

  • Configure production backends
  • Monitor crashes
  • Respond to reviews
  • Plan updates

Pre-Deployment Checklist

  • All tests pass (⌘U)
  • No warnings in build
  • Tested on real device
  • Performance is smooth
  • No crashes in common flows
  • Real backends configured (not mock)
  • API keys in Config/Secrets.xcconfig
  • Bundle ID matches App Store Connect
  • Version number set (e.g., 1.0.0)
  • Build number set (start at 1)
  • App icon (1024×1024)
  • Screenshots for all sizes
  • App description written
  • Keywords added
  • Support URL set

TestFlight Deployment

1. Archive Build

# In Xcode
Product Archive

# Wait for archive to complete
# Organizer window opens automatically

2. Validate Archive

# In Organizer
1. Select your archive
2. Click "Validate App"
3. Choose options:
   - Upload symbols: Yes
   - Manage version: No
4. Click "Validate"
5. Fix any errors

3. Upload to App Store

# In Organizer
1. Click "Distribute App"
2. Choose "App Store Connect"
3. Next Upload
4. Wait for processing (~5-10 minutes)

4. Add Testers

Internal Testers (up to 100):
  • App Store Connect → TestFlight → Internal Testing
  • Add team members
  • They receive email invite
  • Install via TestFlight app
External Testers (up to 10,000):
  • Create group: “Beta Testers”
  • Add email addresses
  • Requires beta review (1-2 days)
  • Public link available

5. Test Thoroughly

  • Sign up flow
  • Chat functionality
  • Subscription purchases (sandbox)
  • Settings and preferences
  • Performance on various devices

App Store Submission

1. Prepare Metadata

In App Store Connect:
App Information:
- Name: Your App Name
- Subtitle: Short description
- Privacy Policy URL: https://yoursite.com/privacy
- Category: Productivity (or your category)
- Content Rights: Does not use third-party content

2. Create Screenshots

Required sizes:
  • 6.7” (iPhone 15 Pro Max): 1290 × 2796
  • 6.5” (older Pro Max): 1284 × 2778
  • 5.5” (older Plus): 1242 × 2208
  • 12.9” iPad Pro: 2048 × 2732 (if supporting iPad)
Tips:
  • 4-10 screenshots per size
  • Show key features
  • Add text overlays
  • First screenshot most important

3. Write Description

Template:
[Your App] is an AI-powered [category] that helps you [benefit].

FEATURES:
• AI Chat - Get instant answers
• Smart Conversations - History saved
• Premium Themes - Beautiful UI
• Cross-Device Sync - Access everywhere

PERFECT FOR:
• [Target audience 1]
• [Target audience 2]

PREMIUM FEATURES:
• Unlimited messages
• All AI models
• Priority support

Privacy Policy: [URL]
Terms: [URL]

4. Configure App Privacy

Answer privacy questionnaire: Data collected:
  • Contact Info: Email (for account)
  • Identifiers: User ID (for backend)
  • Usage Data: App interactions (if analytics)
  • User Content: Chat messages
For each: Linked to identity, Used for app functionality

5. Submit for Review

# In App Store Connect
1. App Store tab Version
2. Add screenshots
3. Add description
4. Select build
5. Submit for Review
Review time: 24-48 hours typically

Production Configuration

Backend Setup

  1. Use production Supabase project
  2. Verify Edge Function deployed (supabase functions deploy ai)
  3. Set production OpenRouter key (supabase secrets set OPENROUTER_API_KEY=...)
  4. Monitor API usage in Supabase dashboard

Final Verification

// In FeatureFlags.swift - Verify production config
public static var crashlyticsEnabled: Bool {
    #if DEBUG
    return false
    #else
    return true  // Enable in production
    #endif
}

// In Config/Secrets.xcconfig - Verify production URLs
SUPABASE_URL = https://production-project.supabase.co
REVENUECAT_API_KEY = appl_PRODUCTION_KEY

Post-Launch

Monitor

  • Crashlytics dashboard (if enabled)
  • App Store Connect analytics
  • RevenueCat subscription metrics
  • Supabase API usage
  • User reviews and ratings

Respond

  • Reply to user reviews
  • Fix critical bugs immediately
  • Plan feature updates
  • Gather user feedback

Update Regularly

Recommended cadence:
  • Bug fixes: As needed (1-3 days)
  • Minor updates: Every 2-4 weeks
  • Major features: Every 2-3 months

Complete Guide

View Complete Launch Checklist

Find complete deployment checklist in your project

Troubleshooting

  • Clean build (⌘⇧K)
  • Check signing certificates
  • Verify provisioning profiles
  • Update Xcode if needed
  • Read rejection carefully
  • Fix specific issues mentioned
  • Update metadata if needed
  • Resubmit with explanation
  • Check Crashlytics logs
  • Reproduce locally
  • Fix and submit hotfix
  • Expedited review if critical