Project: petfolio-v1 · Sender ID: 86798095066
firebase projects:list
firebase use petfolio-v1
firebase apps:list --project petfolio-v1Refresh Flutter + Android + web config from the console (no MCP required):
.\tool\sync_firebase_from_cli.ps1Or manually:
flutterfire configure --project=petfolio-v1 --yes --platforms=android,web --out=lib/firebase_options.dart
firebase apps:sdkconfig ANDROID --project petfolio-v1 -o android/app/google-services.jsonWeb service worker config: web/firebase-config.js (generated by the script above from firebase apps:sdkconfig WEB).
Repo files: .firebaserc, firebase.json, lib/firebase_options.dart, android/app/google-services.json.
.envmust includeFIREBASE_VAPID_KEY(Firebase Console → Cloud Messaging → Web Push certificates → Key pair public value; CLI does not expose this).- Run:
flutter run --dart-define-from-file=.env - Sign in so FCM tokens register in
user_fcm_devices.
Set secrets via CLI (from repo root). The JSON must be a single minified line (invalid JSON in the secret causes send-fcm-notification HTTP 500):
# Place petfolio-v1-firebase-adminsdk-*.json in repo root (gitignored), then:
.\tool\set_fcm_supabase_secrets.ps1
# Or: .\tool\set_fcm_supabase_secrets.ps1 -ServiceAccountPath "C:\path\to\key.json"Or manually:
# One-time: minify service account JSON + random dispatch UUID into a temp env file, then:
npx supabase secrets set --env-file supabase/.secrets.fcm.env --project-ref jqyjvhwlcqcsuwcqgcwfRequired secrets: FIREBASE_SERVICE_ACCOUNT_JSON, FCM_DISPATCH_SECRET (must match SQL below).
SQL (same UUID as FCM_DISPATCH_SECRET in Supabase):
UPDATE private.fcm_internal_config
SET dispatch_secret = 'your-uuid-here'
WHERE id = 1;Status: Secrets pushed via CLI; private.fcm_internal_config.dispatch_secret synced on hosted project.
npx supabase functions deploy send-fcm-notification --no-verify-jwt
npx supabase functions deploy process-fcm-outbox --no-verify-jwt
npx supabase functions deploy process-care-fcm-reminders --no-verify-jwt| Event | Source |
|---|---|
| Like, comment, follow, KYC | notifications INSERT |
| Chat message | chat_messages INSERT |
| New match | matches INSERT |
| Order status | marketplace_orders UPDATE |
| Care reminders | care_web_reminders + cron |
- Android:
android/app/src/main/res/raw/chat_message.wav+ channelpetfolio_chat_v2(created at app start; legacypetfolio_chatis removed on launch). - iOS:
ios/Runner/chat_message.wavin the app bundle. - Server: Chat Android pushes are data-only (tray + sound via
flutter_local_notifications); iOS uses APNs alert +chat_message.wav. - Replace
chat_message.wavwith your own short sound (keep the filename) and reinstall the app so Android recreates the channel.
- Run app, sign in, allow notifications.
- Firebase Console → Messaging → test message with device FCM token from debug logs.
- Or trigger in-app (e.g. send a chat message to another user with FCM registered).