Purpose
The Push module helps validate and send Firebase Cloud Messaging payloads. It resolves target tokens from configured sources, supports script-based token selection, and records send results.
Outputs
TABLE: token/source/result rowsJSON: raw payload, resolved token data, and service responsesLOGS: validation, resolver, API, and 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.
- Send with explicit confirmation.
- Review per-token results 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.
- Failed sends should expose actionable per-token errors.
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