feat(notifications): add WebSocket push + local notifications#3
Open
renatobardi wants to merge 1 commit into
Open
feat(notifications): add WebSocket push + local notifications#3renatobardi wants to merge 1 commit into
renatobardi wants to merge 1 commit into
Conversation
Deliver kura-server pushes in real time without a paid Apple Developer account: a menu bar app does not need APNs. NotificationsClient connects to the Phoenix Channel notifications:<uid> and LocalNotifier surfaces each "push" event via UserNotifications. - KuraEndpoint: single source for the socket URL (DEBUG localhost / wss) - PushPayload: defensive parse of the "push" event payload - LocalNotifier: UserNotifications wrapper (no capability required) - NotificationsClient: SwiftPhoenixClient socket+channel, connect/disconnect - AppDelegate: request auth on launch, drive socket from authState - Info.plist: NSAllowsLocalNetworking for ws://localhost in dev DEBUG connects with raw user_id (server test env); the Firebase ID token path is written-but-commented, mirroring AuthManager. APNs can be layered on later without changing the payload. See docs/notifications-spec.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Entrega de notificações via WebSocket (Phoenix Channel) + notificações locais (UserNotifications), sem APNs nem conta Apple Developer paga. Puxa para a Fase 4 o caminho de
docs/notifications-spec.md(server já pronto).Core/API/KuraEndpoint.swift— URL única do socket (DEBUGws://127.0.0.1:4000/ prodwss://)Core/Notifications/PushPayload.swift— model + parse defensivo do eventopushCore/Notifications/LocalNotifier.swift— wrapper UserNotifications (sem capability)Core/Notifications/NotificationsClient.swift— SwiftPhoenixClient socket+channel,connect(userID:)/disconnect(), junta-se anotifications:<uid>App/AppDelegate.swift— autorização no launch, observaauthState, banner em foreground, tap abre popoverInfo.plist—NSAllowsLocalNetworkingparaws://localhostem devWhy
A conta Apple Developer paga está travada e bloqueava o E2E de notificações (único caminho era APNs, que exige conta paga). Como o Kura é menu bar sempre aberto, não precisa de APNs: o server entrega em tempo real por WebSocket e o app dispara notificações locais. Destrava o fluxo agora; APNs entra por cima depois sem mudar o payload.
How
user_idcru (aceito pelo server em test env); path de produção com Firebase ID token escrito-mas-comentado emNotificationsClient, espelhando oAuthManager. Params via closure para token fresco a cada reconexão.channel.on("push")→PushPayload→LocalNotifier.show. Delegate mostra banner mesmo em foreground.AppDelegateassinaAuthManager.shared.$authStatevia Combine.xcodebuild build→ BUILD SUCCEEDED. E2E contra kura-server em test env: passos no fim dedocs/notifications-spec.md.Fora de escopo (intencional): APNs/capability, deep-link por
data.type(views Fase 4 ainda não existem), persistência de notificações.🤖 Generated with Claude Code