Purpose
The Push module helps validate Firebase Cloud Messaging payloads, resolve target tokens from configured sources, and run clearly labeled simulated or guarded send attempts. Real FCM delivery remains unclaimed until approved live project/device evidence exists.
Outputs
TABLE: token/source/result rowsJSON: raw payload, resolved token data, validation output, simulated results, and guarded send responsesLOGS: validation, resolver, API, simulated-send, and guarded-send logs
Token Sources
Push token sources can come from project-level configuration such as Firestore token paths, Auth/Firestore user mappings, saved token lists, or scripts. Script templates help users build repeatable token resolution workflows.
Use named token sources for repeatable QA and support workflows. A saved source should explain where tokens come from, which project setting owns the path or script, and how stale or invalid tokens will be reported after a send attempt.
Send Flow
A typical flow:
- Select the target project.
- Configure or choose a token source.
- Enter notification/data payload fields.
- Validate the payload.
- Resolve tokens.
- Run a clearly labeled simulated send or a guarded send attempt with explicit confirmation.
- Review per-token simulated results, guarded-attempt errors where available, and logs.
Keep payload review separate from delivery. Validate notification fields, data keys, token count, and environment before pressing send, especially when the selected project is production or the token source comes from linked Auth and Firestore records.
Safety
- Push send is Pro-gated.
- Production sends require explicit confirmation.
- Token scripts are Pro-gated and should be treated like local code execution.
- Simulated sends must stay visibly labeled and cannot count as real delivery evidence.
- Failed guarded send attempts should expose actionable per-token errors.
Current Verification
- Payload validation, token-source resolution, no-credential dry-run simulation, live-send credential enforcement, per-target HTTP response capture, read-only rejection, and production confirmation are covered by service and CLI tests.
- Real FCM delivery remains open until an approved live project/device fixture records API responses and cleanup or token invalidation notes.
Source Anchors
Sources/FirestructApp/Features/Push/UI/PushModuleView.swiftSources/FirestructApp/Features/Push/Services/AppModel+PushActions.swiftSources/FirestructApp/Features/Push/Services/AppModel+PushTokenSourcePersistence.swiftSources/FirestructCore/PushTestingService.swiftSources/FirestructCore/PushTokenSourceResolverService.swiftSources/FirestructCore/PushTokenScriptTemplates.swift