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
1 change: 1 addition & 0 deletions _includes/sidelist-programming/programming-flutter.html
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@
<li lang="flutter" ><a href="{{ site.dbr_flutter }}release-notes/flutter-11.html" class="otherLinkColour">Version 11.x</a></li>
</ul>
</li>
<li lang="flutter" ><a href="{{ site.dbr_flutter }}license-activation.html" class="otherLinkColour">License Initialization</a></li>
<li lang="flutter"><a class="otherLinkColour">Choose a Language</a>
<ul>
<li><a target="_blank" href="{{ site.android }}" class="otherLinkColour refreshLink">Android (Java & Kotlin)</a></li>
Expand Down
2 changes: 1 addition & 1 deletion _includes/sidelist-programming/programming-maui.html
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@
<li lang="maui"><a href="{{ site.dbr_maui_v10 }}release-notes/maui-10.html" class="otherLinkColour">10.x</a></li>
</ul>
</li>

<li lang="maui" ><a href="{{ site.dbr_maui }}license-activation.html" class="otherLinkColour">License Initialization</a></li>
<li lang="maui" ><a href="{{ site.dbr_maui }}upgrade.html" class="otherLinkColour">Upgrade from 10.x to 11.x</a></li>
<li lang="maui" ><a href="{{ site.dbr_maui }}migrate-from-xamarin-to-maui.html" class="otherLinkColour">Migrate from Xamarin Forms</a></li>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@
<li lang="react-native" ><a href="{{ site.dbr_react_native }}release-notes/react-native-11.html" class="otherLinkColour">Version 11.x</a></li>
</ul>
</li>
<li lang="react-native" ><a href="{{ site.dbr_react_native }}license-activation.html" class="otherLinkColour">License Initialization</a></li>
<li lang="react-native"><a class="otherLinkColour">Choose a Language</a>
<ul>
<li><a target="_blank" href="{{ site.android }}" class="otherLinkColour refreshLink">Android (Java & Kotlin)</a></li>
Expand Down
41 changes: 41 additions & 0 deletions programming/flutter/license-activation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: default-layout
title: License Activation - Dynamsoft Barcode Reader Flutter Edition
description: Initialize the license of Dynamsoft Barcode Reader Flutter edition.
keywords: license initialization, licensing
needAutoGenerateSidebar: true
---

# License Initialization

## Get a trial license

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.

You can contact our support team via the [Contacting Us](https://www.dynamsoft.com/contact/){:target="_blank"} link when your license generation failed.

## Get a Full License

[Contact us](https://www.dynamsoft.com/company/contact){:target="_blank"} to purchase a full license.

## Set the License In the Code

### For BarcodeScanner

```dart
var config = BarcodeScannerConfig(license: "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", scanningMode: scanningMode);
BarcodeScanResult barcodeScanResult = await BarcodeScanner.launch(config);
```

### For Foundational Barcode Reader

The following shows how to set the license in the code.

```dart
LicenseManager.initLicense('DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9').then((data) {
final (isSuccess, message) = data;
if (!isSuccess) {
print("license error: $message");
}
});
```
57 changes: 57 additions & 0 deletions programming/maui/license-activation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
layout: default-layout
title: License Activation - Dynamsoft Barcode Reader MAUI Edition
description: Initialize the license of Dynamsoft Barcode Reader MAUI edition.
keywords: license initialization, licensing
needAutoGenerateSidebar: true
---

# License Initialization

## Get a trial license

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.

You can contact our support team via the [Contacting Us](https://www.dynamsoft.com/contact/){:target="_blank"} link when your license generation failed.

## Get a Full License

[Contact us](https://www.dynamsoft.com/company/contact){:target="_blank"} to purchase a full license.

## Set the License In the Code

### For BarcodeScanner

```csharp
var config = new BarcodeScannerConfig("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9");
var result = await BarcodeScanner.Start(config);
```

### For Foundational Barcode Reader

The following shows how to set the license in the code.

```csharp
public partial class CameraPage : ContentPage, ILicenseVerificationListener
{
public CameraPage()
{
InitializeComponent();
LicenseManager.InitLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", this);
}
public void OnLicenseVerified(bool isSuccess, string message)
{
if (!isSuccess)
{
Console.WriteLine("License initialization failed: " + message);
}
}
public void OnFailure(int errorCode, string errorMessage)
{
MainThread.BeginInvokeOnMainThread(() =>
{
DisplayAlert("Error", errorMessage, "OK");
});
}
}
```
23 changes: 9 additions & 14 deletions programming/react-native/expo-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ LicenseManager.initLicense(License).catch(e => {

### Preparation

1. Create a new Expo project with the following command:
Create a new Expo project with the following command:

```bash
npx create-expo-app ScanBarcodes
cd ScanBarcodes
```

2. Follow the [installation section](#installation) to install the dependencies and generate native projects.
```bash
npx create-expo-app ScanBarcodes
cd ScanBarcodes
```

### Installation

Expand Down Expand Up @@ -109,9 +107,7 @@ cd ..

### Implementing the Barcode Scanner

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.

Replace the content of `app/(tabs)/index.tsx` with the following code:
To implement the barcode scanning feature, replace the content of `app/(tabs)/index.tsx` with the following code:

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

> [!Note]
>
> - The LICENSE string here grants a time-limited free trial which requires network connection to work.
> - 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.
> - 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.
> - The license string here is a trial license. Note that network connection is required for this license to work.
> - 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.

### Run the App

Expand Down
44 changes: 44 additions & 0 deletions programming/react-native/license-activation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
layout: default-layout
title: License Activation - Dynamsoft Barcode Reader React Native Edition
description: Initialize the license of Dynamsoft Barcode Reader React Native edition.
keywords: license initialization, licensing
needAutoGenerateSidebar: true
---

# License Initialization

## Get a trial license

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.

You can contact our support team via the [Contacting Us](https://www.dynamsoft.com/contact/){:target="_blank"} link when your license generation failed.

## Get a Full License

[Contact us](https://www.dynamsoft.com/company/contact){:target="_blank"} to purchase a full license.

## Set the License In the Code

### For BarcodeScanner

```js
const LICENSE = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
const StartScanning = (): Promise<BarcodeScanResult> => {
let barcodeScanConfig = {
license: LICENSE
} as BarcodeScanConfig;
return BarcodeScanner.launch(barcodeScanConfig);
};
```

### For Foundational Barcode Reader

The following shows how to set the license in the code.

```js
const License = 'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9';
LicenseManager.initLicense(License).catch(e => {
Alert.alert('License error', e.message);
});
```