nomadcode/apps/mobile/README.md
toki 663919c8b0 refactor: organize roadmap phases and update mobile app structure
- Reorganize roadmap archives into phase-based directory structure
- Add PHASE.md files for each roadmap phase
- Update mobile app: remove Mattermost-specific push notification code
- Update mobile app: migrate to workspace-based authentication
- Update pubspec.yaml and platform configs for nomadcode app
2026-05-25 13:59:24 +09:00

39 lines
2.4 KiB
Markdown

# nomadcode-app
The Flutter-first NomadCode client application.
## Mattermost Push Notification Integration
Mattermost push notification delivery is implemented via the local `mattermost_push_plugin` path dependency.
### Architecture & Responsibility Split
To maintain a clean and maintainable codebase, the responsibilities are split between the host application and the plugin as follows:
#### Host Application (`apps/mobile`) Responsibilities:
- **Firebase Configuration**: Contains the standard Firebase configuration files (`android/app/google-services.json`) and performs the standard `Firebase.initializeApp()` call in Dart main.
- **Mattermost Authentication**: Handles login and session lifecycles, and securely registers the user authentication token and server signing key to the plugin by calling `MattermostPushPlugin.instance.setAuthToken()` and `MattermostPushPlugin.instance.setSigningKey()`.
- **Navigation Callbacks**: Registers standard Flutter navigation callbacks `onNavigateToChannel` and `onNavigateToThread` to handle workspace channel and CRT thread routing upon user interaction.
- **FCM Token Sync**: Listens to device token registrations via `onDeviceTokenReady` and registers the token with the Mattermost server.
#### Mattermost Push Plugin (`mattermost_push_plugin`) Responsibilities:
- **Native Android FCM Service**: Intercepts background/foreground FCM notifications securely via a custom Kotlin FCM service.
- **Signature Verification**: Validates incoming push payload signatures against stored public signing keys (using `JJWT`).
- **System Notification Builder**: Displays structured notifications with local avatar caches, thread summaries, and action buttons.
- **Inline Reply / Dismiss Actions**: Receives native background actions, records responses in a Room database, and forwards replies/ACKs directly to the Mattermost API via custom OkHttp adapters.
---
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Learn Flutter](https://docs.flutter.dev/get-started/learn-flutter)
- [Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Flutter learning resources](https://docs.flutter.dev/reference/learning-resources)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.