Skip to content

Commit 0c14b52

Browse files
Merge pull request #389 from dynamsoft-docs/preview
Updating side list with license activation
2 parents 024971a + 569e0b0 commit 0c14b52

7 files changed

Lines changed: 154 additions & 15 deletions

File tree

_includes/sidelist-programming/programming-flutter.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@
490490
<li lang="flutter" ><a href="{{ site.dbr_flutter }}release-notes/flutter-11.html" class="otherLinkColour">Version 11.x</a></li>
491491
</ul>
492492
</li>
493+
<li lang="flutter" ><a href="{{ site.dbr_flutter }}license-activation.html" class="otherLinkColour">License Initialization</a></li>
493494
<li lang="flutter"><a class="otherLinkColour">Choose a Language</a>
494495
<ul>
495496
<li><a target="_blank" href="{{ site.android }}" class="otherLinkColour refreshLink">Android (Java & Kotlin)</a></li>

_includes/sidelist-programming/programming-maui.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@
550550
<li lang="maui"><a href="{{ site.dbr_maui_v10 }}release-notes/maui-10.html" class="otherLinkColour">10.x</a></li>
551551
</ul>
552552
</li>
553-
553+
<li lang="maui" ><a href="{{ site.dbr_maui }}license-activation.html" class="otherLinkColour">License Initialization</a></li>
554554
<li lang="maui" ><a href="{{ site.dbr_maui }}upgrade.html" class="otherLinkColour">Upgrade from 10.x to 11.x</a></li>
555555
<li lang="maui" ><a href="{{ site.dbr_maui }}migrate-from-xamarin-to-maui.html" class="otherLinkColour">Migrate from Xamarin Forms</a></li>
556556

_includes/sidelist-programming/programming-react-native.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@
532532
<li lang="react-native" ><a href="{{ site.dbr_react_native }}release-notes/react-native-11.html" class="otherLinkColour">Version 11.x</a></li>
533533
</ul>
534534
</li>
535+
<li lang="react-native" ><a href="{{ site.dbr_react_native }}license-activation.html" class="otherLinkColour">License Initialization</a></li>
535536
<li lang="react-native"><a class="otherLinkColour">Choose a Language</a>
536537
<ul>
537538
<li><a target="_blank" href="{{ site.android }}" class="otherLinkColour refreshLink">Android (Java & Kotlin)</a></li>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
layout: default-layout
3+
title: License Activation - Dynamsoft Barcode Reader Flutter Edition
4+
description: Initialize the license of Dynamsoft Barcode Reader Flutter edition.
5+
keywords: license initialization, licensing
6+
needAutoGenerateSidebar: true
7+
---
8+
9+
# License Initialization
10+
11+
## Get a trial license
12+
13+
You can request a 30-day trial license via the [Request a Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=docs&package=mobile){:target="_blank"} link.
14+
15+
You can contact our support team via the [Contacting Us](https://www.dynamsoft.com/contact/){:target="_blank"} link when your license generation failed.
16+
17+
## Get a Full License
18+
19+
[Contact us](https://www.dynamsoft.com/company/contact){:target="_blank"} to purchase a full license.
20+
21+
## Set the License In the Code
22+
23+
### For BarcodeScanner
24+
25+
```dart
26+
var config = BarcodeScannerConfig(license: "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", scanningMode: scanningMode);
27+
BarcodeScanResult barcodeScanResult = await BarcodeScanner.launch(config);
28+
```
29+
30+
### For Foundational Barcode Reader
31+
32+
The following shows how to set the license in the code.
33+
34+
```dart
35+
LicenseManager.initLicense('DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9').then((data) {
36+
final (isSuccess, message) = data;
37+
if (!isSuccess) {
38+
print("license error: $message");
39+
}
40+
});
41+
```
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
layout: default-layout
3+
title: License Activation - Dynamsoft Barcode Reader MAUI Edition
4+
description: Initialize the license of Dynamsoft Barcode Reader MAUI edition.
5+
keywords: license initialization, licensing
6+
needAutoGenerateSidebar: true
7+
---
8+
9+
# License Initialization
10+
11+
## Get a trial license
12+
13+
You can request a 30-day trial license via the [Request a Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=docs&package=mobile){:target="_blank"} link.
14+
15+
You can contact our support team via the [Contacting Us](https://www.dynamsoft.com/contact/){:target="_blank"} link when your license generation failed.
16+
17+
## Get a Full License
18+
19+
[Contact us](https://www.dynamsoft.com/company/contact){:target="_blank"} to purchase a full license.
20+
21+
## Set the License In the Code
22+
23+
### For BarcodeScanner
24+
25+
```csharp
26+
var config = new BarcodeScannerConfig("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9");
27+
var result = await BarcodeScanner.Start(config);
28+
```
29+
30+
### For Foundational Barcode Reader
31+
32+
The following shows how to set the license in the code.
33+
34+
```csharp
35+
public partial class CameraPage : ContentPage, ILicenseVerificationListener
36+
{
37+
public CameraPage()
38+
{
39+
InitializeComponent();
40+
LicenseManager.InitLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", this);
41+
}
42+
public void OnLicenseVerified(bool isSuccess, string message)
43+
{
44+
if (!isSuccess)
45+
{
46+
Console.WriteLine("License initialization failed: " + message);
47+
}
48+
}
49+
public void OnFailure(int errorCode, string errorMessage)
50+
{
51+
MainThread.BeginInvokeOnMainThread(() =>
52+
{
53+
DisplayAlert("Error", errorMessage, "OK");
54+
});
55+
}
56+
}
57+
```

programming/react-native/expo-guide.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,12 @@ LicenseManager.initLicense(License).catch(e => {
5757

5858
### Preparation
5959

60-
1. Create a new Expo project with the following command:
60+
Create a new Expo project with the following command:
6161

62-
```bash
63-
npx create-expo-app ScanBarcodes
64-
cd ScanBarcodes
65-
```
66-
67-
2. Follow the [installation section](#installation) to install the dependencies and generate native projects.
62+
```bash
63+
npx create-expo-app ScanBarcodes
64+
cd ScanBarcodes
65+
```
6866

6967
### Installation
7068

@@ -109,9 +107,7 @@ cd ..
109107

110108
### Implementing the Barcode Scanner
111109

112-
New Expo projects use [Expo Router](https://docs.expo.dev/router/introduction/) with a file-based routing system. The main entry point is located in the `app` folder instead of a root `App.tsx` file.
113-
114-
Replace the content of `app/(tabs)/index.tsx` with the following code:
110+
To implement the barcode scanning feature, replace the content of `app/(tabs)/index.tsx` with the following code:
115111

116112
```tsx
117113
import {
@@ -125,7 +121,7 @@ import React, {useEffect, useRef} from 'react';
125121
import {Alert, AppState, StyleSheet, View} from 'react-native';
126122
// Initialize the license.
127123
// The license string here is a trial license. Note that network connection is required for this license to work.
128-
// You can request an extension via the following link: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=samples&package=react-native
124+
// You can request an extension via the following link: https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=guide&package=react-native
129125
const License = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
130126
LicenseManager.initLicense(License).catch(e => {
131127
Alert.alert('License error', e.message);
@@ -214,9 +210,8 @@ export default App;
214210

215211
> [!Note]
216212
>
217-
> - The LICENSE string here grants a time-limited free trial which requires network connection to work.
218-
> - You can request a 30-day trial license via the [Request a Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=guide&package=react-native){:target="_blank"} link.
219-
> - If you download the <a href="https://www.dynamsoft.com/barcode-reader/downloads/?utm_source=docs#mobile" target="_blank">Installation Package</a>, it comes with a 30-day trial license by default.
213+
> - The license string here is a trial license. Note that network connection is required for this license to work.
214+
> - You can request an extension via the [Request a Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=guide&package=react-native){:target="_blank"} link.
220215
221216
### Run the App
222217

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
layout: default-layout
3+
title: License Activation - Dynamsoft Barcode Reader React Native Edition
4+
description: Initialize the license of Dynamsoft Barcode Reader React Native edition.
5+
keywords: license initialization, licensing
6+
needAutoGenerateSidebar: true
7+
---
8+
9+
# License Initialization
10+
11+
## Get a trial license
12+
13+
You can request a 30-day trial license via the [Request a Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=docs&package=mobile){:target="_blank"} link.
14+
15+
You can contact our support team via the [Contacting Us](https://www.dynamsoft.com/contact/){:target="_blank"} link when your license generation failed.
16+
17+
## Get a Full License
18+
19+
[Contact us](https://www.dynamsoft.com/company/contact){:target="_blank"} to purchase a full license.
20+
21+
## Set the License In the Code
22+
23+
### For BarcodeScanner
24+
25+
```js
26+
const LICENSE = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
27+
const StartScanning = (): Promise<BarcodeScanResult> => {
28+
let barcodeScanConfig = {
29+
license: LICENSE
30+
} as BarcodeScanConfig;
31+
return BarcodeScanner.launch(barcodeScanConfig);
32+
};
33+
```
34+
35+
### For Foundational Barcode Reader
36+
37+
The following shows how to set the license in the code.
38+
39+
```js
40+
const License = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
41+
LicenseManager.initLicense(License).catch(e => {
42+
Alert.alert('License error', e.message);
43+
});
44+
```

0 commit comments

Comments
 (0)