npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-linea

v1.4.0

Published

React Native wrapper for Linea Pro SDK

Readme

react-native-linea

INSTALLATION

npm i react-native-linea --save

Read this: http://stackoverflow.com/questions/13935378/how-do-i-use-the-linea-pro-sdk-for-ios Especially the 2nd answer (its more recent than the other one)

Usage

Include the class at the top of your file like: import LineaPro from 'react-native-linea'

You should create an instance of the LineaPro and save it somewhere. I don't have the best practice, but I saved it in the state (which is probably bad practice, so let me know if you have a better one):

import React from 'react';
import LineaPro from 'react-native-linea';

class Test extends React.Component {
    constructor() {
        this.setState({
            linea: new LineaPro(),
        });
    }
    ...
}

Available methods

initialize

Initialize the scanner and make the app recognize it.

addConnectionStateListener(callback)

There's a delegate in objective c which is called when the scanner is connected. Give your function as a parameter to the above function and the data will be passed through to that function as a callback

addRfCardListener(callback)

Same as above, when an RF card is scanned, the data is passed through to your function

addDebugListener(callback)

Same as above, but then for debugging might you need it. Check the .m file if you want to debug. You can add debug lines in the .m file which are send to JavaScript so you can debug.

scanRf

Call this function to activate the RF card scanner. The RF scanner is automatically turned off everytime a card is scanned.

Example

...
import LineaPro from 'react-native-linea';

class Test extends React.Component {
    constructor() {
        ...
        this.setState({
            linea: new LineaPro
        })

        this.connectionStateListener = this.connectionStateListener.bind(this);
        this.rfCardInfoListener = this.rfCardInfoListener.bind(this);
        this.debugListener = this.debugListener.bind(this);
        this.magneticInfoListener = this.magneticInfoListener.bind(this);
        this.activateScanner = this.activateScanner.bind(this);
    }

    componentDidMount() {
        this.state.linea.initialize();

        this.state.linea.addConnectionStateListener(this.connectionStateListener);
        this.state.linea.addDebugListener(this.debugListener);
        this.state.linea.addRfCardListener(this.rfCardInfoListener);
        this.state.linea.addMagneticInfoListener(this.magneticInfoListener);
    }

    activateScanner() {
        this.state.linea.scanRfId();
    }

    connectionStateListener(data) {
        ...
    }

    rfCardInfoListener(data) {
        ...     
    }
    
    debugListener(data) {
        ...
    }

    magneticInfoListener(data) {
        ...
    }

    render() {
        return (
            <TouchableOpacity onPress={this.activateScanner}>
                <View>
                    <Text>Activate scanner</Text>
                </View>
            </TouchableOpacity>
        )
    }
}