Skip to content

Commit 6fc4394

Browse files
StefanKScanbotMarko
andauthored
v8.0.0 (#313)
* Initial v8 update * Updated dependencies * Update RN to 0.81.4 * Updating to latest RC * Update codesnippets * Update Libraries.txt * Code snippet improvements * Added handling errors snippets * Small updates for version 8.0.0 * Added error handling on BarcodeCameraViewScreen.tsx * 8.0.0-rc.1 * Added image-ref codesnippets * 8.0.0-rc.2 * 8.0.0-rc.3 * Added image ref serialization snippets * v8.0.0 --------- Co-authored-by: Marko <marko@scanbot.io>
1 parent d9a8e9c commit 6fc4394

62 files changed

Lines changed: 3408 additions & 2616 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,6 @@ yarn-error.log
7474
!.yarn/versions
7575
.yarn/cache
7676
.yarn/*
77+
78+
# Misc
79+
licence.ts

App.tsx

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect } from 'react';
2-
import { ActivityIndicator, StyleSheet, View } from 'react-native';
2+
import { ActivityIndicator, StyleSheet } from 'react-native';
33
import { createNativeStackNavigator } from '@react-navigation/native-stack';
44
import { NavigationContainer } from '@react-navigation/native';
55
import {
@@ -10,18 +10,17 @@ import {
1010
useBarcodeFormats,
1111
useLoading,
1212
} from '@context';
13+
import { SafeAreaProvider } from 'react-native-safe-area-context';
1314
import { COLORS, NavigationTheme } from '@theme';
1415
import { FILE_ENCRYPTION_ENABLED, Screens, ScreenTitles } from '@utils';
16+
1517
import { BarcodeDocumentFormatsScreen } from './src/screens/BarcodeDocumentFormatsScreen';
1618
import { BarcodeCameraViewScreen } from './src/screens/BarcodeCameraViewScreen';
1719
import { BarcodeFormatsScreen } from './src/screens/BarcodeFormatsScreen';
1820
import { HomeScreen } from './src/screens/HomeScreen';
19-
import { ImageResultsScreen } from './src/screens/ImageResultsScreen';
2021
import { BarcodeResultsScreen } from './src/screens/BarcodeResultsScreen';
2122

22-
import ScanbotBarcodeSDK, {
23-
ScanbotBarcodeSdkConfiguration,
24-
} from 'react-native-scanbot-barcode-scanner-sdk';
23+
import ScanbotBarcodeSDK, { SdkConfiguration } from 'react-native-scanbot-barcode-scanner-sdk';
2524

2625
const Stack = createNativeStackNavigator();
2726

@@ -41,38 +40,32 @@ export default function App() {
4140
const [loading, setLoading] = useLoading();
4241

4342
useEffect(() => {
44-
const configuration: ScanbotBarcodeSdkConfiguration = {
43+
const configuration = new SdkConfiguration({
4544
// Consider switching logging OFF in production builds for security and performance reasons!
4645
loggingEnabled: true,
4746
enableNativeLogging: false,
4847
licenseKey: LICENSE_KEY,
4948
// Optional custom storage directory
50-
// storageBaseDirectory: Platform.select({
51-
// ios: DocumentDirectoryPath + '/my-custom-storage',
52-
// android: ExternalDirectoryPath + '/my-custom-storage',
53-
// default: undefined,
54-
// }),
55-
};
49+
// storageBaseDirectory: DocumentDirectoryPath + '/my-custom-storage',
50+
});
5651

5752
// Set the following properties to enable encryption.
5853
if (FILE_ENCRYPTION_ENABLED) {
5954
configuration.fileEncryptionMode = 'AES256';
6055
configuration.fileEncryptionPassword = 'SomeSecretPa$$w0rdForFileEncryption';
6156
}
6257

63-
ScanbotBarcodeSDK.initializeSdk(configuration)
58+
ScanbotBarcodeSDK.initialize(configuration)
6459
.then(result => {
6560
console.log(result);
6661
})
6762
.catch(error => {
6863
console.error('Initialization error: ', error.message);
6964
});
70-
71-
console.log(`Using ${(global as any)?.nativeFabricUIManager ? 'New' : 'Old'} Architecture`);
7265
}, []);
7366

7467
return (
75-
<View style={styles.container}>
68+
<SafeAreaProvider>
7669
<BarcodeDocumentFormatContext.Provider value={barcodeDocumentFormatsValues}>
7770
<BarcodeFormatsContext.Provider value={barcodeFormatsValues}>
7871
<ActivityIndicatorContext.Provider value={{ setLoading }}>
@@ -93,7 +86,6 @@ export default function App() {
9386
name={Screens.BARCODE_CAMERA_VIEW}
9487
component={BarcodeCameraViewScreen}
9588
/>
96-
<Stack.Screen name={Screens.IMAGE_RESULTS} component={ImageResultsScreen} />
9789
<Stack.Screen name={Screens.BARCODE_RESULTS} component={BarcodeResultsScreen} />
9890
</Stack.Navigator>
9991
</NavigationContainer>
@@ -106,14 +98,11 @@ export default function App() {
10698
</ActivityIndicatorContext.Provider>
10799
</BarcodeFormatsContext.Provider>
108100
</BarcodeDocumentFormatContext.Provider>
109-
</View>
101+
</SafeAreaProvider>
110102
);
111103
}
112104

113105
const styles = StyleSheet.create({
114-
container: {
115-
flex: 1,
116-
},
117106
loadingIndicator: {
118107
elevation: 6,
119108
position: 'absolute',

0 commit comments

Comments
 (0)