BbitbbitBook Dev Log #6 — Scanning Books: The World of ISBNs

The Book Registration Friction
Using the app has a routine:
Finish a book. Open the app. Tap the search field. Type the title. Browse results. Select the right one.
That works. But for anyone with the physical book in hand, scanning the barcode on the back cover would be significantly faster.
I added a barcode scanning feature.
Barcode Scanning on iOS
iOS barcode scanning uses the AVFoundation framework.
Open the camera, specify supported barcode formats, read the scanned value. The basic implementation is straightforward.
A book's barcode is its ISBN (International Standard Book Number). Scan the barcode on the back cover, get a 13-digit number. Pass that number to a book search API, get the book's information back.
Simple in theory.
The Problem: One Book, Multiple ISBNs
Books have more than one barcode on the back cover in some editions. ISBN-10 and ISBN-13 may both be present. Publisher-specific codes may appear alongside ISBNs.
More significantly: the same title can have multiple valid ISBNs. Hardcover and paperback editions are different ISBNs. Revised editions are different ISBNs. Different publisher editions of the same text are different ISBNs.
I expected scanning to identify one specific book. In practice, scanning could match several versions of the same title.
The Solution: Show Results, Let Users Choose
The ideal experience: scan → one book registered automatically.
The ISBN reality made that unreliable. The implementation became:
Scan barcode → display matching results → user selects the correct edition.
One extra step compared to fully automatic, but accuracy is much higher. The user can confirm "yes, this is the edition I read" before registering.
Automatic would have been more elegant. Wrong-book-silently-registered would have been worse.
A Later Bug: Barcode Scanner Crash
After the 1.2.0 update, the barcode scanner developed a bug.
Camera-related code had conflicted during the update process. Firebase Crashlytics logs showed crashes originating in the barcode scanning flow. The fix shipped in 1.2.2.
Lesson: camera-dependent features need explicit testing with every update. Camera permissions, AVFoundation session management, and iOS-version-specific behavior can all change in unexpected ways when surrounding code is updated.