FitHub member app – Android guide

Build, sign and publish on Google Play

Overview

This guide shows how to build the FitHub member app for Android 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

  • Flutter SDK (stable channel, Dart 3.13 or newer) – flutter doctor must show no errors for Android.
  • Android Studio (or the command-line tools) with the Android SDK, and JDK 17.
  • A Google Play Console developer account to publish.
  • Your installed FitHub web address with HTTPS.

1. Open and configure

  1. Open the android_app folder in Android Studio or VS Code and run flutter pub get.
  2. App name: change android:label in android/app/src/main/AndroidManifest.xml (default FitHub).
  3. App id: the default is com.fithub.fithub_member. Change namespace and applicationId in android/app/build.gradle.kts to your own id (for example com.yourcompany.gymapp) before you publish. The id cannot be changed after the first upload to Google Play. If you rename it, also move the Kotlin folder under android/app/src/main/kotlin and update its package line.
  4. Icon: replace the ic_launcher.png files in the android/app/src/main/res/mipmap-* folders.
  5. Version: set version: 1.0.0+1 in pubspec.yaml (name+build number). Raise the build number for every upload.

2. Run it

Connect a phone or start an emulator 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

On the Android emulator the computer's own server is http://10.0.2.2/.... Enter a gym code (shown in the owner panel under Website → App), sign in with a member account and check each section. 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 Android app with your application id.
  2. Download google-services.json and put it in android/app/. The build picks it up automatically; without it the app still works, just without notifications.
  3. In Firebase open Project settings → Service accounts, generate a private key (JSON) and paste it in the FitHub admin under Mobile app → Push notifications.

Members then receive a notification when a class seat opens, an automatic renewal fails or the gym posts a notice. Tapping it opens the right screen.

4. Create your signing key

Google Play only accepts apps signed with your own key. Create it once and keep it safe – if you lose it you cannot update the app.

keytool -genkey -v -keystore ~/fithub-upload.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload

Create android/key.properties (do not share or commit it):

storePassword=YOUR_PASSWORD
keyPassword=YOUR_PASSWORD
keyAlias=upload
storeFile=/full/path/to/fithub-upload.jks

Then in android/app/build.gradle.kts load this file and use it for the release build, as described in the official Flutter guide Sign the app. Until you do this, release builds are signed with the debug key and Google Play will refuse them.

5. Build the release

flutter build appbundle --release --dart-define=API_BASE_URL=https://your-domain.com/api/v1 --dart-define=APP_VERSION=1.0.0

The file is created at build/app/outputs/bundle/release/app-release.aab. For a file you can install directly on a phone use flutter build apk --release with the same options.

APP_VERSION must match the version in pubspec.yaml. The app compares it with the oldest version you allow in the admin panel.

6. Publish on Google Play

  1. In the Play Console create an app (name, language, free or paid, declarations).
  2. Fill in the store listing: short and full description, icon (512×512), feature graphic (1024×500) and phone screenshots.
  3. Complete App content: privacy policy link, data safety form (the app sends the member's account details and visits to your server), target audience.
  4. Open Production → Create new release, upload the .aab, add release notes and submit for review. A new developer account may need to run a closed test first; the Console tells you if so.
  5. When it is live, copy the Play 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
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 notificationsgoogle-services.json is in android/app/, the Firebase key is saved in the admin panel, and the member allowed notifications.
Camera does not openThe member must allow camera access to scan a gym QR code; typing the code always works.