Capacitor Android

Milestone 1 uses Capacitor as an Android shell for native push notifications. Runtime application content is loaded from the hosted dashboard PWA through server.url; native Android code does not call authenticated backend APIs.

Environment

Set the dashboard URL before syncing Android:

sh
FRONTEND_URL_DASHBOARD=https://www.webdevelop.biz/dashboard npm run cap:sync:android

capacitor.config.ts also accepts VITE_FRONTEND_DASHBOARD. If neither value is set, the config falls back to https://www.webdevelop.biz/dashboard so local sync commands still produce a deterministic native project.

Firebase

Create or select the Firebase Android app with package id biz.webdevelop.www. Download the Firebase config from the Firebase console and place it at:

text
android/app/google-services.json

The Android Gradle build applies the Google Services plugin only when this file is present. Push notifications will not work without it or if its package_name does not match the Android applicationId.

Build And Sync

Install dependencies and build the web fallback assets:

sh
npm install
npm run build

Sync Capacitor config, plugins, web assets, and native metadata:

sh
FRONTEND_URL_DASHBOARD=https://www.webdevelop.biz/dashboard npm run cap:sync:android

Open the native project:

sh
npm run cap:open:android

Use JDK 21 for Android builds. The generated Capacitor Android config sets Java 21 source/target compatibility.

CLI debug build:

sh
cd android
./gradlew :app:assembleDebug

Android Studio owns device selection, signing configuration, release builds, and Play Store artifact generation. Keep versioning in android/app/build.gradle (versionCode and versionName) aligned with the release being produced.

Release

  1. Confirm FRONTEND_URL_DASHBOARD points at the intended hosted dashboard environment.
  2. Confirm android/app/google-services.json belongs to the same Firebase app/package id.
  3. Run npm run build.
  4. Run npm run cap:sync:android.
  5. Build a signed Android App Bundle from Android Studio.
  6. Upload the generated .aab to Play Console.

Manual QA

Use a real Android 13+ device. Validate first-login consent, OS permission grant/deny, FCM token subscription through the PWA session, foreground inbox refresh, background tray delivery, tap-through routing, relaunch registration, and local unregister on logout.