FitHub member app – iPhone guide

Build, sign and publish on the App Store

Overview

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).

Requirements

  • A Mac with the latest Xcode and the command-line tools – iPhone apps cannot be built on Windows or Linux.
  • Flutter SDK (stable channel, Dart 3.13 or newer) and CocoaPods (sudo gem install cocoapods) – flutter doctor must show no errors for iOS.
  • An Apple Developer Program account to publish and to use push notifications.
  • Your installed FitHub web address with HTTPS.

1. Open and configure

  1. Open the iphone_app folder in Terminal and run flutter pub get, then cd ios && pod install.
  2. Open ios/Runner.xcworkspace in Xcode (always the .xcworkspace, not the .xcodeproj).
  3. Select the Runner target → Signing & Capabilities: choose your Team and set a unique Bundle Identifier (default com.fithub.fithubMember; use your own, for example com.yourcompany.gymapp). It cannot be changed after the first App Store upload.
  4. App name: change CFBundleDisplayName in ios/Runner/Info.plist (default FitHub).
  5. Icon: replace the images in ios/Runner/Assets.xcassets/AppIcon.appiconset (or drag a 1024×1024 icon into the AppIcon set in Xcode).
  6. Version: set 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.

2. Run it

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.0

Enter 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.

3. Push notifications (optional)

  1. In the Firebase console create a project and add an iOS app with your bundle identifier.
  2. Download GoogleService-Info.plist. In Xcode drag it into the Runner folder and tick Copy items if needed and the Runner target.
  3. In Xcode → Signing & Capabilities click + Capability and add Push Notifications and Background Modes (tick Remote notifications).
  4. In the Apple Developer site create an APNs Auth Key (.p8); in Firebase open Project settings → Cloud Messaging and upload it with your Key ID and Team ID.
  5. In Firebase open Project settings → Service accounts, generate a private key (JSON) and paste it in the FitHub admin under Mobile app → Push notifications.

Without these files the app still works, just without notifications. Push does not work on the simulator; test on a real iPhone.

4. Build the release

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.

5. Upload to App Store Connect

  1. In App Store Connect create the app with the same bundle identifier.
  2. Upload the build: open build/ios/archive/Runner.xcarchive in Xcode (Window → Organizer) and choose Distribute App → App Store Connect, or upload the .ipa with the Transporter app.
  3. Wait for Apple to finish processing the build (an e-mail tells you). You can test it first with TestFlight.

6. Publish on the App Store

  1. Fill in the App Information: name, subtitle, category, privacy policy URL and support URL.
  2. Add the screenshots for the required iPhone sizes, a description, keywords and the age rating.
  3. Complete App Privacy (the app sends the member's account details and visits to your server).
  4. Give Apple a demo account (a member e-mail and password plus the gym code) in the review notes, because the app is only useful after sign-in.
  5. Choose the uploaded build, then Submit for Review. When it is live, copy the App Store link into Mobile app in the FitHub admin panel.

7. Connect it in the admin panel

Log in as Super Admin and open Mobile app:

  1. Paste the store link(s) once the app is published. Gym websites then show a Get the app page with the gym code and these links.
  2. Set the latest version and the oldest version allowed. An app older than the oldest version is asked to update before it can be used. Leave both at 1.0.0 until you need to force an update.
  3. Paste the Firebase service-account key under Push notifications to switch push on (optional, see above).

Troubleshooting

ProblemWhat to check
Pods or signing errorsRun cd ios && pod install, open the .xcworkspace and choose your Team under Signing & Capabilities.
Gym code not foundOpen 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 updateAPP_VERSION is older than the oldest version allowed in Mobile app.
No notificationsTest 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.