Quack provides a native Android app that wraps the web application with background push notification support. The app uses Capacitor to create a native shell that loads content from your Quack server.
- Background notifications even when the app is closed
- Custom notification sound
- Deep links to specific channels/threads
- Auto-reconnect on network changes
- Persists after device reboot
- Battery optimization exemption for reliable operation
- Android Studio (with Android SDK)
- Node.js and npm
- A deployed Quack server (the mobile app loads content from your server)
The mobile app needs to know your Quack server URL. You can configure it in one of two ways:
Option A: Using environment variable
cd mobile
export QUACK_SERVER_URL="https://your-quack-server.com"Option B: Using direnv
cd mobile
cp .envrc.example .envrc
# Edit .envrc with your server URL
direnv allowcd mobile
npm install# Sync Capacitor configuration
npm run cap:sync
# Open in Android Studio
npm run cap:openFrom Android Studio, you can build the APK or run on a connected device/emulator.
If you have the Android SDK configured:
npm run cap:runFor local development with HTTPS (required for service workers):
-
Generate SSL certificates:
deno task ssl
-
Start the backend and frontend:
# Terminal 1: Backend deno task dev # Terminal 2: Frontend cd app && npm run dev
-
Configure mobile to use local dev server:
cd mobile export QUACK_SERVER_URL="https://localhost:3000" npm run cap:sync
-
Install the SSL certificate on your Android emulator:
- Copy
ssl/cert.pemto emulator - Go to Settings > Security > Install from storage
- Select the certificate
- Copy
-
Run the app:
npm run cap:run
Note: The app automatically converts localhost to 10.0.2.2 for Android emulator compatibility.
- User logs in via the web interface
- Web app calls the native plugin to start the notification service
- A foreground service starts and connects to
/api/mobile/notificationsvia SSE - Server pushes notification events when new messages arrive
- The service displays Android notifications with custom sound
- Tapping a notification opens the app to the relevant channel/thread
Replace the launcher icons in:
mobile/android/app/src/main/res/mipmap-*/ic_launcher*.png
Place your notification sound at:
mobile/android/app/src/main/res/raw/quack_notification.mp3
Recommended: Short (< 1 second), distinctive sound in MP3 or OGG format.
Edit mobile/android/app/build.gradle:
applicationId- Package name (e.g.,io.codecat.quack)versionCodeandversionName- App version
Edit mobile/capacitor.config.ts:
appId- Must matchapplicationIdappName- Display name
- Check notification permission in Android Settings > Apps > Quack
- Disable battery optimization for the app
- Verify the foreground service notification is visible
- Request battery optimization exemption in app settings
- On some OEMs (Xiaomi, Huawei, Samsung), manually whitelist the app in their battery/power management settings
- Verify server URL is correct and accessible
- Check network connectivity
- View logs:
adb logcat | grep Quack
- Ensure SSL certificate is installed on emulator
- Verify frontend dev server is running on port 3000
- Check that
QUACK_SERVER_URLis set correctly
For detailed architecture and API documentation, see mobile/README.md.