Push notifications — env & akun (Fase 0)
Setup manual sekali sebelum push/email hidup di production.
Status lokal (2026-08-15)
| Item | Status |
|---|---|
Migration 023 di mpcdb (localhost:5432) | Done |
mpc-be FCM (FCM_PROJECT_ID + credentials) + Resend | Done (lihat mpc-be/.env) |
Android google-services.json (com.mpc.app) | Done (project mpclub-a3b1e) |
POS google-services.json (com.mpc.mpc_pos) | Done (app Firebase dibuat via CLI) |
Admin/Owner NEXT_PUBLIC_FIREBASE_* + MPC_BE_URL + ADMIN_API_KEY | Done |
| Web Push VAPID key | Masih manual (lihat bawah) |
| iOS / APNs | Ditunda (mpc-dev/docs/tasks.md) |
Firebase (FCM)
- Buat Firebase project untuk MPC.
- Tambah app: Android package, iOS bundle ID, Web (Admin + Owner bisa share project; bedakan via
appId/token metadata), Flutter POS. - Unduh:
google-services.json→ Android / POS AndroidGoogleService-Info.plist→ iOS (setelah Apple Developer aktif)- Service account JSON (Firebase Console → Project settings → Service accounts → Generate new private key)
- Set di server
mpc-be:FCM_PROJECT_ID= project id FirebaseFCM_CREDENTIALS_JSON= isi JSON service account (satu baris / escaped), atauGOOGLE_APPLICATION_CREDENTIALS= path absolut ke file service account JSON di disk (bukangoogle-services.json). Contoh lokal:/Users/glen/Studios/KSR/mpc-be/mpclub-a3b1e-firebase-adminsdk-fbsvc-19b1a4f06c.json
- Apple (blokir iOS sampai selesai): enroll Apple Developer Program → APNs Auth Key (
.p8) → upload ke Firebase Cloud Messaging. Lihatmpc-dev/docs/tasks.md. - Web Push VAPID (Admin/Owner): Isi
NEXT_PUBLIC_FIREBASE_VAPID_KEYdi.envadmin & owner dari Firebase Console → Project settings → Cloud Messaging → Web Push certificates → Generate key pair (pakai public key yang tampil).
Resend (email member web)
- Buat akun Resend, verifikasi domain pengirim.
- Set:
RESEND_API_KEYEMAIL_FROM(contohMPC <noreply@yourdomain.com>)MEMBER_WEB_BASE_URL(link di body email, defaulthttps://mpc.example.com)
Env ringkas (mpc-be)
Lihat mpc-be/.env.example. Tanpa kredensial FCM/Resend, BE tetap jalan: inbox in-app ditulis; push/email di-skip (log warning).
POS register token (local)
flutter run --dart-define=ADMIN_API_KEY=local-dev-admin-key \
--dart-define=MPC_BE_BASE=http://10.0.2.2:8080/api/v1
(emulator Android pakai 10.0.2.2 untuk host machine; device fisik pakai IP LAN.)