iOS SDK - Most common pitfalls
A curated list of frequently encountered issues when integrating the barKoder iOS SDK—and their proven solutions.
Keep this page updated as new support cases emerge.
Known Issues & Resolutions #
1. How to Use Thumbnails and Full Scanned Image #
Issue: By default, thumbnail previews and full scanned images are not returned in scanning results, which may limit your UI or post-processing capabilities.
Solution: Enable them in your configuration using the following settings:
private func setBarkoderSettings() {
guard let config = barkoderView.config else { return }
config.imageResultEnabled = true
config.locationInImageResultEnabled = true
}
2. MRZ scanning Turn of Flush #
Solution: If you want to turn on the flash (torch) together when startScanning is called, here is how to do it:
1. Initialize Barkoder when the view is created:
async function onBarkoderViewCreated(_barkoder: Barkoder) {
try {
_barkoder.setBarcodeTypeEnabled(Barkoder.BarcodeType.idDocument, true);
_barkoder.setRegionOfInterestVisible(true);
setBarkoder(_barkoder);
} catch (error) {
console.error('Error initializing Barkoder:', error);
Alert.alert('Error', 'Failed to initialize Barkoder');
}
}
2. When the the scan button is pressed:
function scanPressed() {
if (!barkoder) {
console.error('Barkoder is not initialized');
return;
}
setTimeout(() => {
barkoder.setFlashEnabled(true);
}, 300);
barkoder.setZoomFactor(2.0);
barkoder.startScanning((result) => {
// handle result
});
}