HOCO B2B
Team tasksImad

MOB-08 — Push notifications foundation

Firebase projects per flavor, FCM token registration, foreground/background handling, notification → deep-link routing.

FieldDetails
Task codeMOB-08
PhaseP0 — Foundations (cadrage, UX/UI, architecture & contract)
Product scopeV1
StatusPlanned
StartThu 29 Oct 2026
DueThu 29 Oct 2026
ResponsibleImad — Mobile developer (Flutter)
Co-responsible—
Effort0.75 person-day(s) planned · 3 from scratch · size S
Area · appMobile foundation · mobile
Depends onMOB-06
UnblocksMRA-08
Milestones—

Summary

Firebase projects per flavor, FCM token registration, foreground/background handling, notification → deep-link routing.

Description

Order status changes, assisted-order confirmations, follow-ups and announcements reach users through FCM push with deep links (NOT-02, INT-02), and device registration also carries the app version the server checks (AUTH-09). Scope: Firebase configuration per flavor for both apps, FCM token registration and refresh through me.devices.register, unregistration on sign-out, notification channels per NotificationCategory, foreground display, background and terminated-state taps routed to the MOB-05 deep-link registry, and the unread badge. The inbox UI is MRA-08 / MDA-11. It needs from Anis the push payload format (type, entity id, deep link) and the FCM sender wired in SRV-08; nothing new from Akram beyond the notification icon. MRA-05, MRA-08, MRA-10 and MDA-11 consume these events.

Subtasks

#SubtaskOwner
1Firebase projects/apps per flavor (dev, staging, prod) for dz.hoco.reseller and dz.hoco.delegate; google-services.json under android/app/src/<flavor>/; flutterfire config documentedImad
2PushService: request POST_NOTIFICATIONS on Android 13+ after sign-in (not at first launch), get the FCM token, call me.devices.register (deviceId, fcmToken, platform, appVersion) with an Idempotency-Key, re-register on onTokenRefresh and app upgradeImad
3Unregister on sign-out (auth.logout or me.devices.remove) and on account switchImad
4Android notification channels mapped to NotificationCategory: « Commandes et compte », « Sécurité », « Activité terrain », « Offres et promotions », « Annonces »; small icon and accent colour from DQA assetsImad
5Foreground display with flutter_local_notifications (suppressed when the user is already on the target screen), background handler, getInitialMessage for taps from a killed appImad
6Payload contract { type, entityId, deepLink } parsed into a route of the MOB-05 registry (/orders/:id, /tickets/:id, /returns/:id, /tasks, /notifications…); unknown types open the inboxImad
7Unread badge provider refreshed from notifications.unreadCount on push receipt and app resumeImad
8Agree the payload format and template keys with Anis and send test pushes from stagingAnis

Deliverables

  • packages/hoco_core/lib/src/push/push_service.dart and deep_link_parser.dart
  • apps/*/android/app/src/{dev,staging,prod}/google-services.json (prod injected in CI)
  • Firebase projects per flavor with FCM enabled and the server key/service account shared with Anis

Acceptance criteria

  • After sign-in the device appears in the user's devices with its app version; a token refresh updates it (AUTH-09)
  • A push for order CMD-2026-000158 tapped from a killed, backgrounded or foregrounded app opens that order's detail (NOT-02)
  • After sign-out the device no longer receives pushes for that user
  • Denying the notification permission does not block the app; the inbox still works
  • Promotional notifications use their own channel so the user can mute them without losing order updates

Requirements covered

RequirementTitleRelease
NOT-02Push notifications (FCM) with deep linksV1
AUTH-09Device registration for push and minimum-app-version enforcementV1
INT-02Firebase Cloud MessagingV1

API surface

Test measures

  • Unit tests of the payload → route parser for every notification type
  • Manual device matrix: killed / background / foreground taps on Android 10, 13 and 14 with test pushes from the Firebase console and from staging
  • Widget test of the badge update on a simulated push

Risks

  • Aggressive OEM battery savers (Xiaomi, Oppo, Samsung) delay or drop pushes — high-priority messages for transactional types and the SSE/inbox refresh on resume as a backstop

KPI

  • Delivered by Thu 29 Oct 2026 within 0.75 person-day(s).
  • Every acceptance criterion above demonstrated before hand-off; linked requirements' acceptance criteria pass.
  • Zero open critical defects, permission gaps or data-integrity regressions at sign-off.

Generated from content/plan/tasks.json by scripts/generate-team-tasks.mjs. Dates are computed by the scheduler (Sunday–Thursday weeks, holidays excluded) — change the plan, not this page.

On this page