This package contains all files needed to make CalTrackPro production-ready for the iOS App Store.
CalTrackPro/
├── Services/
│ ├── FoodRecognitionService.swift # AI food recognition + USDA/OpenFoodFacts APIs
│ ├── AuthenticationService.swift # Sign in with Apple
│ ├── HealthKitService.swift # Apple Health integration
│ └── CloudSyncService.swift # iCloud/CloudKit sync
├── Resources/
│ ├── PrivacyInfo.xcprivacy # REQUIRED: Privacy manifest for App Store
│ └── privacy-policy.html # Host on easyaiflows.com/caltrackpro/privacy
├── Config/
│ ├── ExportOptions.plist # App Store build export config
│ ├── InfoPlistAdditions.plist # Privacy permission strings
│ └── AppStoreMetadata.md # Description, keywords, screenshots guide
├── CalTrackPro.entitlements # HealthKit, Sign in with Apple, CloudKit
├── build_for_appstore.sh # One-command App Store build script
└── README.md # This file
Copy the Services/ folder into your Xcode project:
- Drag the folder into Xcode
- Select "Copy items if needed"
- Add to target: CalTrackPro
- Copy
Resources/PrivacyInfo.xcprivacyto your project root - In Xcode: File → Add Files → Select
PrivacyInfo.xcprivacy - Ensure it's added to your target
Add these keys from Config/InfoPlistAdditions.plist:
- NSCameraUsageDescription
- NSPhotoLibraryUsageDescription
- NSHealthShareUsageDescription
- NSHealthUpdateUsageDescription
- UIBackgroundModes
Select your target → Signing & Capabilities → + Capability:
- HealthKit (check "Background Delivery")
- Sign in with Apple
- iCloud (select CloudKit, create container)
- Push Notifications
Upload privacy-policy.html to: https://easyaiflows.com/caltrackpro/privacy
In Config/ExportOptions.plist:
- Replace
YOUR_TEAM_IDwith your Apple Developer Team ID - Verify bundle ID:
com.ronnienutrition.CalTrackPro
// In your view or view model:
@StateObject private var foodService = FoodRecognitionService()
// Recognize food from photo:
let results = try await foodService.recognizeFood(from: image)
// Results include:
// - name: "Grilled Chicken"
// - confidence: 0.87
// - calories: 165
// - protein: 31.0
// - carbs: 0.0
// - fat: 3.6@StateObject private var authService = AuthenticationService()
// In your login view:
SignInWithAppleButtonView()
.environmentObject(authService)
// Check auth state:
switch authService.authState {
case .authenticated(let user):
// Show main app
case .unauthenticated:
// Show login
}@StateObject private var healthKit = HealthKitService()
// Request authorization:
try await healthKit.requestAuthorization()
// Save food entry:
try await healthKit.saveFoodEntry(
calories: 450,
protein: 30,
carbs: 45,
fat: 15
)
// Get today's summary:
await healthKit.fetchTodaySummary()
let calories = healthKit.todaySummary.calories@StateObject private var cloudSync = CloudSyncService()
// Save entry to iCloud:
try await cloudSync.saveFoodEntry(entry)
// Fetch entries for date:
let entries = try await cloudSync.fetchFoodEntries(for: Date())- Go to: https://fdc.nal.usda.gov/api-key-signup.html
- Sign up for free API key
- Add to your project:
// In FoodRecognitionService, replace: private let apiKey = "YOUR_USDA_API_KEY"
Barcode lookup works without API key.
- Product → Archive
- Window → Organizer
- Distribute App → App Store Connect → Upload
# Make script executable
chmod +x build_for_appstore.sh
# Run build (update TEAM_ID first)
./build_for_appstore.sh 1.0.0 1- All services integrated and tested
- No compiler warnings
- App launches in < 3 seconds
- Tested on real device (not just simulator)
- Tested camera + barcode on device
- App created in App Store Connect
- Privacy manifest (PrivacyInfo.xcprivacy) included
- Privacy policy URL active and accessible
- Screenshots prepared (see AppStoreMetadata.md)
- App icon 1024x1024 uploaded
- Description and keywords filled
- Age rating questionnaire completed
- App Privacy section completed
- HealthKit enabled + usage descriptions
- Sign in with Apple enabled
- CloudKit container created
- Push notifications enabled
- HealthKit doesn't work in Simulator
- Test on real device
- Verify capability is enabled
- Check entitlements file is included in build
- Create container in Xcode capabilities
- Container name:
iCloud.com.ronnienutrition.CalTrackPro - Deploy schema to production in CloudKit Console
- Verify PrivacyInfo.xcprivacy is in app bundle
- Check all usage descriptions are filled
- Ensure privacy policy URL is accessible
Questions? Email: support@easyaiflows.com
Built for CalTrackPro by Ronnie Nutrition