r/iOSProgramming • u/AlbertiDev • Aug 22 '26
Question Receipt scanning entirely on-device. Would you still build it this way in 2026?
I recently added receipt scanning to my iOS finance app, Moneta.
It can extract the amount, date and merchant, then also try to determine the category, payment account and location before filling everything into the transaction editor.
I decided to keep the processing on-device instead of sending financial receipts to a cloud AI/API.
The biggest challenge ended up being handling receipts from different countries: currencies, date formats, multiple totals, different payment methods and completely different layouts.
If you were building this today, would you still keep the whole pipeline on-device, or use a cloud model for better flexibility?
And for anyone who’s built document/receipt parsing before: where did deterministic parsing start breaking down for you?
10
u/balooooooon Aug 22 '26
If you had cloud processing then GDPR in the EU would make it very difficult for you to launch it. Plenty of on device OCR to easily achieve this
7
u/sid_276 Aug 22 '26
ios27 has it. https://www.apple.com/newsroom/2026/06/apple-unveils-innovative-features-and-intelligence-experiences-across-services/
3
u/zeroxad- Aug 23 '26
Yes, and I would go further than most people do.
I ship a finance app with no backend at all. The thing that surprised me was not the engineering, it was that the claim is worthless unless someone can check it. "On-device" is a sentence, and users have been told it by apps that were lying.
So the interesting work turned out to be enforcement rather than architecture. A build check fails if any first-party file so much as names a network primitive. The test suite runs with fetch, XMLHttpRequest and WebSocket replaced by traps that throw, so a dependency reaching for the network fails the build too. Neither catches a native dependency opening its own socket, so there is a device run behind a proxy before each release.
Three checks, three blind spots, and none of them is the whole claim alone. That framing did more for how people trust the app than the on-device processing did by itself.
3
u/Notchgoblin Aug 23 '26
One thing worth doing early if you haven't: store the raw Vision output, text plus bounding boxes, next to the transaction. Parser rules keep improving and the paper receipt is in the bin the same day, so if you keep only the parsed fields you can never fix an old mistake. Keep the OCR blob and a rule change becomes a reparse of everything you've ever scanned.
On where deterministic parsing starts falling over: totals. Subtotal, tax, tip line, "TOTAL" printed twice on the same receipt, loyalty points formatted exactly like money. Position beats keywords there - bottom-most currency-shaped number in the price column is right far more often than anything anchored to a word, especially once you're crossing languages.
2
u/jacobs-tech-tavern Aug 23 '26
I once worked on a gov project that used Scandit instead of local scanning to read tens of millions of qr codes a day - 2p a pop, purely “in case” it can’t read qrs in poor light conditions
Nobody had the wise idea to route to local first and fall back to the spenny version only if needed
2
u/Akara91 Aug 23 '26
yes, and id go further: make on-device the selling point, not just the architecture. our app is fully offline on principle (no account, no server) and its consistently the thing people react to first when we show it, before any feature. for financial data especially, 'your receipts never leave the phone' is worth more in the app store description than a slightly smarter parser. the real tradeoff youve already found: improving extraction means shipping updates instead of tweaking a server. i can live with that
1
u/sixtypercenttogether Aug 22 '26
What did you use? Did you train your own model?
0
u/DimensionMindless336 Aug 23 '26
Kept mine on-device and wouldn't change it. The real win isn't accuracy, it's no per-scan API bill and Apple not asking why you're shipping financial docs to a third party. Where deterministic parsing actually broke for me (I hit the same wall building PicSlicer, pulling travel tickets out of the photo roll) was never the clean prints.
It was thermal fading, multi-currency receipts where the symbol doesn't match the amount, and date formats that collide with the merchant name. Those are exactly the cases a small on-device model beats rules on. If I built it today I'd go hybrid: rules for the common 90%, a local model as fallback, cloud only for the genuinely weird ones.
2
u/[deleted] Aug 23 '26
[removed] — view removed comment
2
u/[deleted] Aug 24 '26
[removed] — view removed comment