Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {useEffect} from 'react';
import {Platform, SafeAreaView, StyleSheet, View} from 'react-native';
import {Platform, StyleSheet} from 'react-native';
import {SafeAreaProvider, SafeAreaView} from 'react-native-safe-area-context';

import ScanbotSDK, {ScanbotSdkConfiguration} from 'react-native-scanbot-sdk';
import {DocumentDirectoryPath, ExternalDirectoryPath} from 'react-native-fs';
Expand All @@ -25,14 +26,14 @@ import {LoadingIndicator} from '@components';
import {HomeScreen} from './src/screens/HomeScreen';
import {MrzResultScreen} from './src/screens/MrzResultScreen';
import {MedicalCertificateResultScreen} from './src/screens/MedicalCertificateResultScreen';
import {DocumentDataExtractorResultScreen} from './src/screens/DocumentDataExtractorResultScreen.tsx';
import {CheckScannerResultScreen} from './src/screens/CheckScannerResultScreen.tsx';
import {DocumentDataExtractorResultScreen} from './src/screens/DocumentDataExtractorResultScreen';
import {CheckScannerResultScreen} from './src/screens/CheckScannerResultScreen';
import {PlainDataResultScreen} from './src/screens/PlainDataResultScreen';
import {DocumentResultScreen} from './src/screens/DocumentResultScreen';
import {DocumentPageResultScreen} from './src/screens/DocumentPageResultScreen';
import {DocumentScannerViewScreen} from './src/screens/DocumentScannerViewScreen.tsx';
import {CroppingScreen} from './src/screens/CroppingScreen.tsx';
import {CreditCardScannerResultScreen} from './src/screens/CreditCardScannerResultScreen.tsx';
import {DocumentScannerViewScreen} from './src/screens/DocumentScannerViewScreen';
import {CroppingScreen} from './src/screens/CroppingScreen';
import {CreditCardScannerResultScreen} from './src/screens/CreditCardScannerResultScreen';

const Stack = createNativeStackNavigator<PrimaryRoutesParamList>();

Expand Down Expand Up @@ -106,8 +107,10 @@ function App() {
const [loading, setLoading] = useLoading();

return (
<View style={styles.container}>
<SafeAreaView style={styles.container}>
<SafeAreaProvider style={styles.container}>
<SafeAreaView
style={styles.container}
edges={['bottom', 'right', 'left']}>
<ActivityIndicatorContext.Provider value={{setLoading}}>
<DocumentContext.Provider value={documentValues}>
<NavigationContainer theme={ScanbotTheme}>
Expand Down Expand Up @@ -162,7 +165,7 @@ function App() {
</ActivityIndicatorContext.Provider>
<LoadingIndicator loading={loading} />
</SafeAreaView>
</View>
</SafeAreaProvider>
);
}

Expand Down
31 changes: 24 additions & 7 deletions Libraries.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Open Source libraries used in the Scanbot SDK for React Native version 7.1.0
Open Source libraries used in the Scanbot SDK for React Native version 7.1.1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Open Source libraries used in the Scanbot SDK for Android version 7.1.1
Open Source libraries used in the Scanbot SDK for Android version 7.1.2

CWAC-Camera

Expand Down Expand Up @@ -64,6 +64,27 @@ See the License for the specific language governing permissions and
limitations under the License.


PdfiumAndroid

Version 103d5855f797af78a6f33f94cb306ef1c23b2290
(https://github.com/barteksc/PdfiumAndroid)

Original work Copyright 2015 Bekket McClane
Modified work Copyright 2016 Bartosz Schiller

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


Kotlin Standard Library

Version 1.9.25
Expand Down Expand Up @@ -3256,7 +3277,7 @@ Version 1.1.0

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Open Source libraries used in ScanbotSDK for iOS version 7.1.2:
Open Source libraries used in ScanbotSDK for iOS version 7.1.4:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Expand Down Expand Up @@ -6347,10 +6368,6 @@ Version 1.1.0







G8Tesseract
Copyright @ 2014 Daniele Galiotto. https://github.com/gali8/Tesseract-OCR-iOS
This library is distributed under the terms of a MIT License (https://github.com/gali8/Tesseract-OCR-iOS/blob/master/LICENSE.md).
Expand Down
20 changes: 10 additions & 10 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,7 @@ PODS:
- React-utils (= 0.79.0)
- RNFS (2.20.0):
- React-Core
- RNScanbotSDK (7.1.0):
- RNScanbotSDK (7.1.1):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1802,7 +1802,7 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- ScanbotSDKNativeWrapper (= 7.1.2.1)
- ScanbotSDKNativeWrapper (= 7.1.4.0)
- Yoga
- RNScreens (4.14.1):
- DoubleConversion
Expand Down Expand Up @@ -1879,11 +1879,11 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- ScanbotSDK (7.1.2):
- ScanbotSDK/NONE (= 7.1.2)
- ScanbotSDK/NONE (7.1.2)
- ScanbotSDKNativeWrapper (7.1.2.1):
- ScanbotSDK (= 7.1.2)
- ScanbotSDK (7.1.4):
- ScanbotSDK/NONE (= 7.1.4)
- ScanbotSDK/NONE (7.1.4)
- ScanbotSDKNativeWrapper (7.1.4.0):
- ScanbotSDK (= 7.1.4)
- SocketRocket (0.7.1)
- Yoga (0.0.0)

Expand Down Expand Up @@ -2205,11 +2205,11 @@ SPEC CHECKSUMS:
ReactCodegen: daf57f5314369a4ad607ee77516d45aad03b10d7
ReactCommon: c07346679f14c0b62ad02b20e18e984da3b575ce
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNScanbotSDK: f144a5858856745ab69964eb30887518f0946163
RNScanbotSDK: 881f2c0ffa87a8ac27203605f512787fb45ea5e6
RNScreens: c2fd33e6c93b4aea8d88b6dcf6bbd8edb3743b41
RNShare: 54d9a98353fe21fdbcf0ade081ce823ea1154a4e
ScanbotSDK: 6af5af26c13b554788ce8f19fff798403701cff0
ScanbotSDKNativeWrapper: 1f7b2a44f0b057a9f1dd2d18ff541caff8622d39
ScanbotSDK: 8fa0da4759e7da6be77e1bc6eea8f60eb5651b28
ScanbotSDKNativeWrapper: 29e6d42aece7cef0a3cde93cc60c493b0a524139
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: 7fb3f48a328f20ea5d5eecd862e91798bd76b255

Expand Down
6 changes: 2 additions & 4 deletions ios/scanbotsdkexample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
</dict>
<key>NSCameraUsageDescription</key>
<string>Scanbot SDK needs camera permission to scan documents</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Import images for document detection</string>
<key>UILaunchStoryboardName</key>
Expand All @@ -43,13 +41,13 @@
<array>
<string>arm64</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"react-native-fs": "2.20.0",
"react-native-image-picker": "^8.2.0",
"react-native-safe-area-context": "^5.4.0",
"react-native-scanbot-sdk": "7.1.0",
"react-native-scanbot-sdk": "7.1.1",
"react-native-screens": "^4.10.0",
"react-native-share": "^12.0.3"
},
Expand Down
22 changes: 22 additions & 0 deletions src/codeSnippets/document/RTUUI/scanningFlow/singlePageScanning.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
DocumentScanningFlow,
startDocumentScanner,
} from 'react-native-scanbot-sdk/ui_v2';

async function useSinglePageScanning() {
try {
/** Create the configuration object for single page scanning */
const configuration = new DocumentScanningFlow();
configuration.outputSettings.pagesScanLimit = 1;

/** See further customization configs... */

const documentResult = await startDocumentScanner(configuration);

/** Handle the document if the status is 'OK' */
if (documentResult.status === 'OK') {
}
} catch (e: any) {
console.error(e.message);
}
}
6 changes: 4 additions & 2 deletions src/codeSnippets/mockCamera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ async function mockCamera() {

try {
/**
* On Android, the READ_EXTERNAL_STORAGE permission is required,
* and the image must have even values for both width and height.
* For Android:
* API >= 33, READ_MEDIA_IMAGES and READ_MEDIA_VIDEO permissions are required.
* API < 33, READ_EXTERNAL_STORAGE permission is required.
* The image must have even values for both width and height.
*/
await ScanbotSDK.mockCamera(config);
} catch (error: any) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/ImageFilterModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
FlatList,
Modal,
Pressable,
SafeAreaView,
StyleSheet,
Text,
View,
ViewStyle,
} from 'react-native';
import {COLORS} from '@theme';
Expand Down Expand Up @@ -64,7 +64,7 @@ export function ImageFilterModal({
}) {
return (
<Modal animationType={'slide'} visible={isVisible} transparent={true}>
<SafeAreaView style={styles.modalContainer}>
<View style={styles.modalContainer}>
<FlatList
data={IMAGE_FILTERS}
contentContainerStyle={styles.flatListContentContainer}
Expand All @@ -80,7 +80,7 @@ export function ImageFilterModal({
ListFooterComponent={<Item label={'CLOSE'} onPress={onDismiss} />}
ListFooterComponentStyle={styles.listFooterStyle}
/>
</SafeAreaView>
</View>
</Modal>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/ResultContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {SafeAreaView, ScrollView, StyleSheet, ViewStyle} from 'react-native';
import {ScrollView, StyleSheet, View, ViewStyle} from 'react-native';
import React from 'react';

export function ResultContainer(props: {
children: React.ReactNode;
style?: ViewStyle;
}) {
return (
<SafeAreaView style={[styles.container, props.style && props.style]}>
<View style={[styles.container, props.style && props.style]}>
<ScrollView showsVerticalScrollIndicator={false}>
{props.children}
</ScrollView>
</SafeAreaView>
</View>
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/screens/DocumentPageResultScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useCallback, useContext, useState} from 'react';
import {SafeAreaView, StyleSheet} from 'react-native';
import {StyleSheet, View} from 'react-native';
import {BottomActionBar, ImageFilterModal, PageImagePreview} from '@components';
import {ParametricFilter} from 'react-native-scanbot-sdk';
import {
Expand Down Expand Up @@ -56,7 +56,7 @@ export function DocumentPageResultScreen() {
}, [onRemovePage]);

return (
<SafeAreaView style={styles.container}>
<View style={styles.container}>
<PageImagePreview pageID={pageID} style={styles.imageDetails} />
<BottomActionBar
buttonOneTitle={'CROP & ROTATE'}
Expand All @@ -71,7 +71,7 @@ export function DocumentPageResultScreen() {
onDismiss={toggleFilterModal}
onSelect={onFilterSelect}
/>
</SafeAreaView>
</View>
);
}

Expand Down
9 changes: 4 additions & 5 deletions src/screens/DocumentResultScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {useCallback, useContext, useState} from 'react';
import {
SafeAreaView,
ScrollView,
StyleSheet,
TouchableOpacity,
Expand Down Expand Up @@ -62,14 +61,14 @@ export function DocumentResultScreen() {

if (document === undefined) {
return (
<SafeAreaView style={styles.container}>
<View style={styles.container}>
<LoadingIndicator loading={true} />
</SafeAreaView>
</View>
);
}

return (
<SafeAreaView style={styles.container}>
<View style={styles.container}>
<ScrollView>
<View style={styles.gallery}>
{document.pages.map(page => (
Expand Down Expand Up @@ -101,7 +100,7 @@ export function DocumentResultScreen() {
documentID={document.uuid}
onDismiss={onDisplayModal(false)}
/>
</SafeAreaView>
</View>
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/screens/DocumentScannerViewScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, {useCallback, useRef, useState} from 'react';
import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {ActionButton} from '@components';

import {
DocumentDetectionStatus,
ScanbotDocumentScannerView,
ScanbotDocumentScannerViewHandle,
} from 'react-native-scanbot-sdk';
import {ActionButton} from '@components';

export function DocumentScannerViewScreen() {
const ref = useRef<ScanbotDocumentScannerViewHandle>(null);
Expand Down
6 changes: 3 additions & 3 deletions src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {SafeAreaView, ScrollView, StyleSheet, Text} from 'react-native';
import {ScrollView, StyleSheet, Text, View} from 'react-native';
import {
useCheckScanner,
useCleanup,
Expand Down Expand Up @@ -55,7 +55,7 @@ export function HomeScreen() {
const onCroppingView = useCroppingView();

return (
<SafeAreaView style={styles.container}>
<View style={styles.container}>
<ScrollView style={styles.list} showsVerticalScrollIndicator={false}>
<FeatureHeader title={'DOCUMENT SCANNING'} />
<FeatureItem
Expand Down Expand Up @@ -138,7 +138,7 @@ export function HomeScreen() {
Copyright {new Date().getFullYear()} Scanbot SDK GmbH. All rights
reserved.
</Text>
</SafeAreaView>
</View>
);
}

Expand Down
Loading