Register the device for push and act on what arrives - #785
Open
michaelst wants to merge 1 commit into
Open
Conversation
A small Swift channel rather than Firebase: `UNUserNotificationCenter` plus `didRegisterForRemoteNotificationsWithDeviceToken`, registered as a Flutter application life cycle delegate so plugins keep receiving the same callbacks. - The device token is PATCHed onto the API token once there is a session to hang it off. - A silent push invalidates the transactions, budget summary and banks providers, so a sync that finished on the server lands on screen without the user pulling to refresh. - A tapped notification opens the transactions tab. The shell's tab moved into its own provider to make that possible, which keeps it out of whatever the Cupertino port does to the shell. Needs the Push Notifications capability and the remote-notification background mode, both declared here. The sync screen's "pull to refresh" copy is now false, so it says what actually happens. Co-Authored-By: Claude Opus 5 <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.
Phase 2b, device half. Stacked on #784 - review that first.
What
ios/Runner/PushChannel.swift:UNUserNotificationCenter+didRegisterForRemoteNotificationsWithDeviceToken, registered withaddApplicationLifeCycleDelegaterather than written onto the app delegate, so plugins keep receiving the same callbacks. No Firebase.PATCHed onto the API token once there is a session to hang it off, and again whenever iOS reissues one.aps-environment) and theremote-notificationbackground mode, without which iOS drops the silent push.Shell change
The tab moved out of
_ShellStateintoselected_tab.dart, because a tapped notification has to be able to move it. Kept in its own file so the Cupertino port can watch the same provider rather than inherit a shell edit.Copy that was no longer true
POST /api/banks/:id/syncsaid "there is no completion signal - pull to refresh" in the API description, the controller doc and the snackbar. There is one now, so all three say what happens. That regenerates the spec andbanks_api.dart.Gates
dart run build_runner build,dart format --line-length 110,flutter analyze,flutter test(86 pass). Elixir gates still green.Not verified here
Nothing iOS has been built or run: this machine has no CocoaPods and no simulator runtime, and push does not work on the simulator anyway - APNs issues no device token there. The Swift compiles only in CI's macOS job. Confirming it works means a real device, a
.p8on the server, and a Plaid sandbox purchase.🤖 Generated with Claude Code