react-native-nfc-manager | React Native NFC module for Android & iOS | iOS library

 by   whitedogg13 Java Version: 3.14.14 License: Apache-2.0

kandi X-RAY | react-native-nfc-manager Summary

kandi X-RAY | react-native-nfc-manager Summary

react-native-nfc-manager is a Java library typically used in Mobile, iOS, React Native, React applications. react-native-nfc-manager has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. However react-native-nfc-manager build file is not available. You can install using 'npm i react-native-nfc-manager-wat2' or download it from GitHub, npm.

React Native NFC module for Android & iOS
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              react-native-nfc-manager has a low active ecosystem.
              It has 698 star(s) with 208 fork(s). There are 24 watchers for this library.
              There were 3 major release(s) in the last 12 months.
              There are 20 open issues and 308 have been closed. On average issues are closed in 587 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of react-native-nfc-manager is 3.14.14

            kandi-Quality Quality

              react-native-nfc-manager has 0 bugs and 0 code smells.

            kandi-Security Security

              react-native-nfc-manager has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              react-native-nfc-manager code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              react-native-nfc-manager is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              react-native-nfc-manager releases are available to install and integrate.
              Deployable package is available in npm.
              react-native-nfc-manager has no build file. You will be need to create the build yourself to build the component from source.
              Installation instructions, examples and code snippets are available.
              It has 1545 lines of code, 86 functions and 33 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed react-native-nfc-manager and discovered the below as its top functions. This is intended to give you an instant insight into react-native-nfc-manager implemented functionality, and help decide if they suit your requirements.
            • Starts the callback
            • Connect to the device
            • Handles writeNDEF request
            • Parse the NDEF intent
            • Checks if the device is supported by the device
            • Checks if MIFare is supported
            • Read a single block
            • Append bytes to a WritableArray
            • Converts an ndef message into an array of NDEF records
            • Convert a JSONArray to a byte array
            • Transforms an rn request to an RTree array
            • Request a NDEF message
            • Determines the maximum transceive length of the device
            • Retrieves the number of blocks in a specific device
            • Sends a new tag when a new tag is found
            • Transfer a specific sector to a mobile device
            • Sets an ndef message
            • Transfare card
            • Decrement a specific card
            • Format an ndef array
            • Get the NDEF status of the NDEF tag
            • Registers a tag event
            • Writes a single block
            • Reads a mifare Card
            • Set the timeout in milliseconds
            • Increment a single card
            Get all kandi verified functions for this library.

            react-native-nfc-manager Key Features

            No Key Features are available at this moment for react-native-nfc-manager.

            react-native-nfc-manager Examples and Code Snippets

            No Code Snippets are available at this moment for react-native-nfc-manager.

            Community Discussions

            QUESTION

            React Native: Reading data from two sectors at once throws "Transceive fail" error
            Asked 2022-Feb-02 at 16:36

            I am currently working on a simple app, where the user scans the NFC tag and receives the data stored on it on the screen.

            I followed this example and everything works fine when I try to authenticate one sector and read & write data from it but, but when I try to read data from two sectors at once I receive the "Transceive fail" error.

            I am testing the app on a Samsung J6 device using a Mifare 1k Card.

            Here is my code:

            ...

            ANSWER

            Answered 2022-Feb-02 at 16:36

            .forEach() doesn't wait for async callbacks (see this article), so your readBulk function is actually calling this.read() on all sectors at once, without waiting for cleanup. forEach is just running through and firing off callbacks for all of the elements in this.sectors.

            To wait for each auth/read/cleanUp cycle before continuing, you can refactor it like so:

            Source https://stackoverflow.com/questions/70825999

            QUESTION

            React native: intent changed after requestTechnology called and NFC card scanned
            Asked 2022-Jan-12 at 20:26

            I am currently working on a simple app, which scans an NFC tag and reads the data from it. To implement it, I followed this example here.

            For testing, I am using a real android device (Samsung Galaxy J6) and a Mifare NFC card.

            At the launch of the app, everything seems fine, the NfcManager has been successfully started, the tag event has been registered (using NfcManager.registerTagEvent),but the problem occurs when requestTechnology has been called and the NFC card scanned.

            The difference I noticed is regarding the intent in Android: before running requestTechnology and scanning the card against the phone, the intent and the action attached to it look like this => the action is on the main thread.

            After that, the intent and the action look like this.

            It seemed strange to me that the action has changed from the main thread.

            The Android code is exactly like given in the link above and the code in React Native looks like this:

            ...

            ANSWER

            Answered 2022-Jan-11 at 22:35

            I'm not sure why you are looking at the Intent Action as it is of no significance to NFC really.

            Some background of how Android handles NFC should help explain it.

            In Android all Tag detection is handled by a System NFC service/App.

            When you App is not running and a NFC Tag is detected the System Service works out if any App has requested to be started when that type of Tag is seen. It then crafts an Intent to get the System Launcher to launch the main Activity of you app and bundles information about the NFC data in the extras section of the Intent for the System Launcher to pass on in the Intent to your app at Launch time.

            When you are doing requestTechnology your App is already running and you are telling the System NFC Service to pass the NFC data directly to your App, the System Launcher does not need to be involved as your App is already running.

            Now Android has two methods of passing this data directly to your running App, enableForegroundDispatch or the later and much better enableReaderMode.

            You configured react-native-nfc-manager to use the older enableForegroundDispatch which tells the system NFC service to send the Tag details directly to your running Activity. So it does not need to add an Action to tell the system Launcher what to do. But to deliver that Intent with the extras contain data about the Tag directly to your App, the only way for it to do that is to basically restart your App which causes a Pause and Resume.

            But react-native-nfc-manager handles all this for you, so you should not need to worry about what is in the Intent

            Note you can configure react-native-nfc-manager to use enableReaderMode and instead of overloading an Intent to deliver this data to you, if basically creates a Thread in your running App and gives the Thread the Tag data directly and thus does not need to pause and resume your App (plus you get more control of things like NFC detection sound with this newer method)

            So overall the behaviour you are seeing is expected and normal and nothing you should be concerned about or have a problem with.

            Note iOS handles this completely differently but again react-native-nfc-manager handles this via it's iOS specific methods.

            Source https://stackoverflow.com/questions/70673277

            QUESTION

            React native paper text input black bar
            Asked 2021-Dec-16 at 18:12

            I'm currently developing a cross platform React Native application. (Non-expo)

            I'm using the following:

            ...

            ANSWER

            Answered 2021-Dec-16 at 18:12
            import React from 'react';
            import {
              StyleSheet,
              SafeAreaView,
              StatusBar,
              View,
              Dimensions,
            } from 'react-native';
            import {TextInput} from 'react-native-paper';
            
            const {width, height} = Dimensions.get('window');
            
            const App = props => {
              return (
                
                  
                    
                  
                
              );
            };
            
            const styles = StyleSheet.create({
              container: {
                flex: 1,
                paddingTop: StatusBar.currentHeight,
                marginHorizontal: 16,
              },
              input: {
                margin: 12,
                color: 'white',
                backgroundColor: 'green',
              },
            });
            export default App;
            

            Source https://stackoverflow.com/questions/70382161

            QUESTION

            Write to specified sector on tag using react-native-nfc-manager
            Asked 2021-Aug-13 at 05:26

            I'm using an NTAG I2C plus 2k memory tag and using the react-native-nfc-manager library to interface with the tag.

            Is there a way to specify the sector that you're intending to write to?

            I know there is an API to specify the page offset to write to, but how do you specify the sector the page offsets are in?

            (Updated to include below code sample)

            ...

            ANSWER

            Answered 2021-Aug-09 at 21:18

            So "NTAG I2C plus 2k" seems to be a Certified Type 2 tag using NfcA comms.

            It's datasheet

            This Tag has additional commands over the Type 2 Standard to select the sector because Type 2 Tag's don't normally have Sectors.

            So reading the datasheet Section 10.12 you would transceive the following commands bytes an example

            C2h FFh - Select Sector

            03h 00h 00h 00h - Sector 3

            Then write to page address as normal with the A2h command byte

            react-native-nfc-manage offers an nfcAHandler with a transceive method to send and receive these low level commands to the NFC chip.

            Update:

            For iOS it treats Type 2 Tags as Mifare Ultralight's and thus sendMifareCommandIOS from the API to send the same commands.

            (Both Android and iOS have the nfcAHandler)

            Note I've not tried this, I just do things with normal Type 2 Tags

            Source https://stackoverflow.com/questions/68717294

            QUESTION

            ISO14443 - React Native NFC sometimes "Tag connection lost" - only on iOS
            Asked 2021-Feb-18 at 07:40
            Context & Problem:
            • I’m writing a React Native application which has to communicate with NFC MiFare Ultralight tags. I have NXP NTAG I2C PLUS ISO14443-3 tags.

            • I’m using the react-native-nfc-manager library for this. On android I didn’t notice any problems just on the iOS side. I’m testing on iOS 13 and 14 and my device is an iPhone 7.

            • I am able to find and connect to NFC Mifare Ultralight tags (can read and write them too), but in the 75% of the situations I get the following error during the communications:

            ...

            ANSWER

            Answered 2021-Feb-18 at 07:40

            At the end I managed to try out our app on multiple iPhones and the NFC worked properly. We also found out that our test device is a refurbished unit and we think that maybe that is the problem's cause.

            Source https://stackoverflow.com/questions/65880686

            QUESTION

            Disable sound in react-native-nfc-manager v2
            Asked 2020-Oct-12 at 08:43

            Version 2 of react-native-nfc-manager is supposed to support disabling the scan sound (https://github.com/whitedogg13/react-native-nfc-manager/issues/60#issuecomment-464352677), however it doesn't seem to work.

            This is the call:

            ...

            ANSWER

            Answered 2020-Jul-11 at 22:38

            Update:
            Impossible for ios, and supposed to work for android (it does work natively) That undocumented Flag is very specific to the undocumented in this library Advanced Android Native direct enableReaderMode API usage.

            The iOS NFC API's and the basic older Android API's have no control over the sounds made by the platform on Tag detection.

            Additional Android Specific
            And looking at the code for Android https://github.com/whitedogg13/react-native-nfc-manager/blob/master/android/src/main/java/community/revteltech/nfc/NfcManager.java

            The following seems to be reported to partially work (I note that it sets other advanced options that mean it probably would only detect a tag once every 10 seconds)

            Source https://stackoverflow.com/questions/62849096

            QUESTION

            Emulate NDEF Tag in ReactNative for Android
            Asked 2020-Jul-13 at 20:09

            I am trying to emulate an NDEF message (NFC Forum Type 4 Tag) using ReactNative. I could not find any working source code or module to achieve this. The only working application is from Maxsoft.bg named NFC NDEF Tag Emulator which is not open source.

            So far I've used react-native-nfc-manager and react-native-nfc-hce, but I couldn't make it work.

            I also checked the android documentation but I couldn't find a working example/sourcecode there as well.

            I found it really strange that I couldn't find even one working source code! So, it would be great if you could help me with a working ReactNative or Android source code.

            ...

            ANSWER

            Answered 2020-Jul-13 at 20:09

            NDEF Message with HCE Android should provide you with the answer for Native Java for Android, the best answer also has linked a github repo with source code demo.

            Source https://stackoverflow.com/questions/62876675

            QUESTION

            How can I send a simple String from an Android with React-Native device to a RaspberryPi using EXPLORE-NFC-WW
            Asked 2020-Mar-26 at 22:12

            this is my very first post so please be gentle. I am mostly looking for Information that could lead me to a good library or a document that could help me out with what im trying to achieve. So far I tried using this library that I found on github to add nfc functionality to my app, which works great with cards and tags but I have no idea how to make it communicate with my pi reader.

            Any help would be much appreciated. Thanks in advance!

            ...

            ANSWER

            Answered 2020-Mar-26 at 22:12

            I don't know about React-Native library but you can access the underlying Android API's so here is a pointer using the Android API's

            But some background first, normally in NFC there is a reading device and a NFC Card. The Reader initialise the NFC comms and the card responds. BUT there is the option of device to device (peer to peer) comms, this uses different underlying comm protocols than device to card

            The right hand column of the image below describes it well

            The Peer to Peer method is called Android Beam and unfortunately been depreciated in favour of Bluetooth/Wifi Direct and is not available in Android 10 and above.

            Documentation for Android Beam is https://developer.android.com/guide/topics/connectivity/nfc/nfc#p2p

            and

            https://developer.android.com/reference/android/nfc/NfcAdapter#setNdefPushMessage(android.nfc.NdefMessage,%20android.app.Activity,%20android.app.Activity...)

            BUT

            there is another more complicated option, it is possible for an Android Device to Emulate a NFC card, this is called Host Card Emulation (HCE), this is probably possible to do on the Raspberry Pi as well.

            Therefore one device pretends to be a NFC Card and the other device reads/writes to it as a Card.

            With HCE you can emulate a Standard Type 4 Tag and then read/write NDEF messages, the answer here https://stackoverflow.com/a/60813707/2373819 goes in to more detail about how to do this.

            Source https://stackoverflow.com/questions/60876278

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install react-native-nfc-manager

            You can install using 'npm i react-native-nfc-manager-wat2' or download it from GitHub, npm.
            You can use react-native-nfc-manager like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the react-native-nfc-manager component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i react-native-nfc-manager

          • CLONE
          • HTTPS

            https://github.com/whitedogg13/react-native-nfc-manager.git

          • CLI

            gh repo clone whitedogg13/react-native-nfc-manager

          • sshUrl

            git@github.com:whitedogg13/react-native-nfc-manager.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular iOS Libraries

            swift

            by apple

            ionic-framework

            by ionic-team

            awesome-ios

            by vsouza

            fastlane

            by fastlane

            glide

            by bumptech

            Try Top Libraries by whitedogg13

            django-rest-framework-redocs

            by whitedogg13Python

            nfc-open-reader

            by whitedogg13JavaScript

            nfc-pokemon-app

            by whitedogg13JavaScript

            react-native-html5-loader

            by whitedogg13JavaScript