Socket
Socket
Sign inDemoInstall

@anyline/anyline-sdk-react-native

Package Overview
Dependencies
0
Maintainers
9
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @anyline/anyline-sdk-react-native

A plugin for connecting Anyline with React-Native


Version published
Maintainers
9
Created

Readme

Source

README

Requirements

iOS

Platform >= 12

Android

minSDK >= 21

How to use the SDK

0. Set up your development environment

To set up a React Native application please follow the instructions from reactnative.dev.

1. Install the Anyline plugin

Install the plugin via npm:

npm i @anyline/anyline-sdk-react-native

Add the dependency to your project and link the plugin via react-native.

yarn add @anyline/anyline-sdk-react-native && react-native link

Optionally for Android: add the repository to the project level build.gradle.

allprojects {
    repositories {
        maven { url 'https://anylinesdk.blob.core.windows.net/maven/' }
    }
}
2. Import AnylineSdk and ReactScanView
import { AnylineSdk, ReactScanView } from '@anyline/anyline-sdk-react-native';
3. Initialise SDK

Initialise the Anyline SDK either with your Trial License or with a Commercial License.
You can optionally listen to success and error callbacks for the initialisation.

class App extends React.Component {
    constructor() {
        super();
        
        AnylineSdk.initSdk(
            "<YOUR LICENSE KEY>",
            (error) => {
                // handle initialisation error
            },
            () => {
                // handle intialisation success
            }
        );
    }
}
4. Add ReactScanView to your view hierarchy

Pass the JSON config file and the result callback method as an attribute to the ReactScanView.

<ReactScanView
    ref = { this.reactScanView }
    style = {{ width: '100%',  height: '100%' }}
    config = "barcode_view_config.json"
    onResult = { this._onResult }
/>
5. Start Scanning

You can start the scan process whenever, but you should not forget to stop the process once component is dismounting.

componentDidMount() {
    this.reactScanView.current.start();
}

componentWillUnmount() {
    this.reactScanView.current.stop();
}

Get help

Please raise a support request using the Anyline Helpdesk. When raising a support request, please fill out and include the following information:

Support request concerning Anyline Github Repository: anyline-sdk-react-native

License

See LICENSE file.

<uses-permission android:name="android.permission.CAMERA" />

Keywords

FAQs

Last updated on 22 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc