
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@anyline/anyline-sdk-react-native
Advanced tools
A plugin for connecting Anyline with React-Native
Currently not supported, will be added in later releases
minSDK >= 21
To set up a React Native application please follow the instructions from reactnative.dev.
Add the dependency to your project and link the plugin via react-native.
yarn add @anyline/anyline-sdk-react-native && react-native link
Add our maven repository to the project level build.gradle.
allprojects {
repositories {
maven { url 'https://anylinesdk.blob.core.windows.net/maven/' }
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.anyline.example.reactnative">
...
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
...
</manifest>
import { AnylineSdk, ReactScanView } from '@anyline/anyline-sdk-react-native';
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
}
);
}
}
You should create a reference ot the ReactScanView
to be able to listen to start and stop the scan easily.
Pass the JSON config file and the result callback method as an attribute to the ReactScanView
.
The config file should be in the assets folder of the Android application located in /android/app/src/main/assets
.
class App extends React.Component {
constructor() {
...
this.reactScanView = React.createRef();
this._onResult = this._onResult.bind(this);
...
}
render() {
<ReactScanView
ref = { this.reactScanView }
style = {{ width: '100%', height: '100%' }}
config = "barcode_view_config.json"
onResult = { this._onResult }
/>
}
}
You can start the scan process whenever you wish, but you should not forget to stop the process once the component is dismounting.
You will receive the result in the _onResult
callback which you pass to the ReactScanView
.
componentDidMount() {
this.reactScanView.current.start();
}
componentWillUnmount() {
this.reactScanView.current.stop();
}
_onResult(event: Event) {
const barcodes = JSON.parse(event.nativeEvent.result);
console.log(barcodes);
}
Currently this ReactNative plugin only supports Barcode scanning and Android as a platform. More products as well as iOS support will be added in the following releases.
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
See LICENSE file.
FAQs
A plugin for connecting Anyline with React-Native
The npm package @anyline/anyline-sdk-react-native receives a total of 0 weekly downloads. As such, @anyline/anyline-sdk-react-native popularity was classified as not popular.
We found that @anyline/anyline-sdk-react-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.