Build, sign and publish on the App Store
This guide shows how to build the FitHub member app for iPhone from this project and publish it. The app is one app for every gym: the member enters (or scans) the gym code and the app takes that gym's name, logo, colours, welcome message and sections. You publish it once from your own account; gym owners rebrand it from the owner panel under Website → App.
The app talks to your FitHub installation through its API at https://your-domain.com/api/v1. Install the web system first and make sure that address opens (it answers with data, not a page).
sudo gem install cocoapods) – flutter doctor must show no errors for iOS.iphone_app folder in Terminal and run flutter pub get, then cd ios && pod install.ios/Runner.xcworkspace in Xcode (always the .xcworkspace, not the .xcodeproj).com.fithub.fithubMember; use your own, for example com.yourcompany.gymapp). It cannot be changed after the first App Store upload.CFBundleDisplayName in ios/Runner/Info.plist (default FitHub).ios/Runner/Assets.xcassets/AppIcon.appiconset (or drag a 1024×1024 icon into the AppIcon set in Xcode).version: 1.0.0+1 in pubspec.yaml. Raise the build number for every upload.The app already contains the explanations iOS shows to the member for the camera (scanning the gym QR code) and the calendar (adding a booked class). Change the wording in Info.plist if you like.
Start a simulator or connect an iPhone and run, pointing the app at your system:
flutter run --dart-define=API_BASE_URL=https://your-domain.com/api/v1 --dart-define=APP_VERSION=1.0.0Enter a gym code (shown in the owner panel under Website → App), sign in with a member account and check each section. The simulator has no camera, so type the gym code. To check the code itself run flutter analyze and flutter test.
GoogleService-Info.plist. In Xcode drag it into the Runner folder and tick Copy items if needed and the Runner target.Without these files the app still works, just without notifications. Push does not work on the simulator; test on a real iPhone.
flutter build ipa --release --dart-define=API_BASE_URL=https://your-domain.com/api/v1 --dart-define=APP_VERSION=1.0.0
The archive is created at build/ios/archive/Runner.xcarchive and the upload file at build/ios/ipa/.
APP_VERSION must match the version in pubspec.yaml. The app compares it with the oldest version you allow in the admin panel.build/ios/archive/Runner.xcarchive in Xcode (Window → Organizer) and choose Distribute App → App Store Connect, or upload the .ipa with the Transporter app.Log in as Super Admin and open Mobile app:
1.0.0 until you need to force an update.| Problem | What to check |
|---|---|
| Pods or signing errors | Run cd ios && pod install, open the .xcworkspace and choose your Team under Signing & Capabilities. |
| Gym code not found | Open https://your-domain.com/api/v1/app-config in a browser; it must return data. Check the address you built with and that the server has HTTPS. |
| App asks to update | APP_VERSION is older than the oldest version allowed in Mobile app. |
| No notifications | Test on a real iPhone. Check the Push Notifications capability, the APNs key in Firebase, GoogleService-Info.plist in the Runner target and the Firebase key in the admin panel. |