Read Wallet on the device - #786
Merged
Merged
Conversation
Pigeon rather than a MethodChannel: the payload is decimal money, dates and enums, and untyped map marshalling is where money bugs breed. The Swift is transport. Amounts go up unsigned with a credit/debit indicator beside them and the server puts the sign on, so there is one place that decides which way money went. Two things the SDK settled that the plan had guessed at: there is no `assetType`, so nothing can tell Apple Cash from Apple Savings without reading the name, which is not worth doing; and history is per account, so the per-account tokens travel together under one opaque string, which is all the server treats it as. Also removes the sync history button. It only ever meant anything for Plaid, and the server now refuses it for anything else. 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.
Stacked on #782. Finishes Phase 3.
Pigeon rather than a MethodChannel - the payload is decimal money, dates and enums, and untyped map marshalling is where money bugs breed.
FinanceKitPlugin.swiftis transport: amounts go up unsigned with a credit/debit indicator beside them, and the server puts the sign on, dedupes, and applies every ledger rule. One place decides which way money went, not two.Wallet is read on launch and on resume when it is already authorized, and the Banks screen offers "Connect Apple" only where
isAvailable()is true - below iOS 17.4 or outside the US, it is not shown at all.Two things the SDK settled that the plan had guessed at
AssetAccounthas noassetType. Nothing can tell Apple Cash from Apple Savings without reading the display name, which is exactly the fragile matching the plan ruled out. So assets map tocashand liabilities tocredit_card.savingsstays in the wire contract - it is a real kind and the server takes it - but nothing emits it. The difference has no behavioural consequence: both are depository accounts, counted incalculate_spendable/1when synced and unassigned. Only thesub_typelabel differs.currentHistoryToken. The per-account tokens travel together as one base64 JSON blob, which is all the server ever treatshistory_tokenas - an opaque string it compares for equality. An account with no entry, a card added since the last read, is read from the beginning while the others resume. Backfill and incremental are the same call with a null token, soread(String?)replaced the plan's two methods.Also
Removes the sync history button. It only ever meant anything for Plaid, and since #780 the server refuses it for anything else.
Verified
flutter build ios --no-codesignsucceeds - the plugin compiles into the real target, which is what proves theproject.pbxprojand plugin registration are right. The Swift also type-checks standalone against the iOS 26.5 SDK at an iOS 17.4 deployment target. 88 Dart tests, analyze clean.Not verified, and cannot be here: FinanceKit has no sandbox and the simulator reports it unavailable. Authorize → backfill → check counts against Wallet → make a purchase → watch the pending charge post in place is a real-device pass that still has to happen.
CI now regenerates the pigeon output and diffs it, the same guarantee the API client already has.
🤖 Generated with Claude Code