You can extract multiple types of structured data in a single scan:
let configuration = GSKScanFlowConfiguration()
// Enable multiple data types
configuration.structuredData = [.receipt, .readableCode, .businessCard]
// Configure readable code types if needed
configuration.structuredDataReadableCodeTypes = [.qr, .ean13]
configuration.multiPage = false
configuration.skipPostProcessingScreen = true
// Start scan flow
self.scanFlow = GSKScanFlow(configuration: configuration)
scanFlow.start(from: viewController, onSuccess: { result in
guard let data = result.scans.first?.structuredDataResult else { return }
// Check what was detected
if let receipt = data.receipt {
// Process receipt data
}
if let codes = data.readableCodes {
// Process barcode data
}
if let card = data.businessCard {
// Process business card data
}
}, failure: { error in
// Handle error
})
val configuration = ScanConfiguration().apply {
// Enable multiple data types
structuredData = EnumSet.of(
StructuredData.RECEIPT,
StructuredData.READABLE_CODE
)
// Configure readable code types if needed
structuredDataReadableCodeTypes = EnumSet.of(
ReadableCode.Type.QR,
ReadableCode.Type.EAN13
)
multiPage = false
}
// Start scan flow
ScanFlow.scanWithConfiguration(activity, configuration)
// Handle result
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
data?.let {
val result = ScanFlow.getScanResultFromActivityResult(data)
val structuredData = result.scans?.first()?.structuredDataResult
// Check what was detected
structuredData?.receipt?.let { receipt ->
// Process receipt data
}
structuredData?.readableCodes?.let { codes ->
// Process barcode data
}
}
}
const configuration = {
// Enable multiple data types
structuredData: ['receipt', 'readableCodes'],
// Configure readable code types if needed
structuredDataReadableCodeTypes: ['qr', 'ean13'],
multiPage: false,
skipPostProcessingScreen: true
};
// Start scan flow
try {
const result = await RNGeniusScan.scanWithConfiguration(configuration);
const structuredData = result.scans?.[0]?.structuredData;
// Check what was detected
if (structuredData?.receipt) {
// Process receipt data
console.log("Receipt merchant:", structuredData.receipt.merchant);
console.log("Receipt amount:", structuredData.receipt.amount);
}
if (structuredData?.readableCodes) {
// Process barcode data
structuredData.readableCodes.forEach(code => {
console.log("Code type:", code.type);
console.log("Code value:", code.value);
});
}
} catch (error) {
// Handle error
console.error("Scan failed:", error);
}
var configuration = {
// Enable multiple data types
'structuredData': ['receipt', 'readableCodes'],
// Configure readable code types if needed
'structuredDataReadableCodeTypes': ['qr', 'ean13'],
'multiPage': false,
'skipPostProcessingScreen': true
};
// Start scan flow
try {
var result = await FlutterGeniusScan.scanWithConfiguration(configuration);
var structuredData = result['scans']?[0]?['structuredData'];
// Check what was detected
if (structuredData != null) {
if (structuredData['receipt'] != null) {
// Process receipt data
var receipt = structuredData['receipt'];
print("Receipt merchant: ${receipt['merchant']}");
print("Receipt amount: ${receipt['amount']}");
}
if (structuredData['readableCodes'] != null) {
// Process barcode data
var codes = structuredData['readableCodes'];
for (var code in codes) {
print("Code type: ${code['type']}");
print("Code value: ${code['value']}");
}
}
}
} catch (error) {
// Handle error
print("Scan failed: $error");
}
var configuration = {
// Enable multiple data types
structuredData: ['receipt', 'readableCodes'],
// Configure readable code types if needed
structuredDataReadableCodeTypes: ['qr', 'ean13'],
multiPage: false,
skipPostProcessingScreen: true
};
// Start scan flow
cordova.plugins.GeniusScan.scanWithConfiguration(configuration,
function(result) {
var structuredData = result.scans?.[0]?.structuredData;
// Check what was detected
if (structuredData) {
if (structuredData.receipt) {
// Process receipt data
console.log("Receipt merchant:", structuredData.receipt.merchant);
console.log("Receipt amount:", structuredData.receipt.amount);
}
if (structuredData.readableCodes) {
// Process barcode data
structuredData.readableCodes.forEach(function(code) {
console.log("Code type:", code.type);
console.log("Code value:", code.value);
});
}
}
},
function(error) {
// Handle error
console.error("Scan failed:", error);
}
);
var configuration = new ScanConfiguration
{
// Enable multiple data types
StructuredData = new[] {
StructuredDataType.Receipt,
StructuredDataType.ReadableCodes
},
// Configure readable code types if needed
StructuredDataReadableCodeTypes = new[] {
ReadableCodeType.QR,
ReadableCodeType.EAN13
},
MultiPage = false,
SkipPostProcessingScreen = true
};
// Start scan flow
try
{
var result = await GeniusScan.ScanWithConfigurationAsync(configuration);
var structuredData = result.Scans?.FirstOrDefault()?.StructuredData;
// Check what was detected
if (structuredData != null)
{
if (structuredData.Receipt != null)
{
// Process receipt data
Console.WriteLine($"Receipt merchant: {structuredData.Receipt.Merchant}");
Console.WriteLine($"Receipt amount: {structuredData.Receipt.Amount}");
}
if (structuredData.ReadableCodes != null)
{
// Process barcode data
foreach (var code in structuredData.ReadableCodes)
{
Console.WriteLine($"Code type: {code.Type}");
Console.WriteLine($"Code value: {code.Value}");
}
}
}
}
catch (Exception ex)
{
// Handle error
Console.WriteLine($"Scan failed: {ex.Message}");
}
© 2025 The Grizzly Labs. All rights reserved.