react-native-nfc-hce | The nfc card-emulation on android | Emulator library
kandi X-RAY | react-native-nfc-hce Summary
kandi X-RAY | react-native-nfc-hce Summary
The nfc card-emulation on android
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Process the specified APDU request
- Concat two arrays
- Gets the ID
- Convert byte array to a hex string
- Build the Select APU header
- Convert a hex string to a byte array
- Set card content
- Sets the ID
- Returns the map of supported constants
- Returns a map of supported NFC support
- Initialize
- Called when the component is deactivated
- Called when the host is destroyed
- Emits an event with a payload
- Create JS modules
- Create native modules
- Create view managers
react-native-nfc-hce Key Features
react-native-nfc-hce Examples and Code Snippets
Community Discussions
Trending Discussions on react-native-nfc-hce
QUESTION
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:09NDEF 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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-native-nfc-hce
Add import studio.bb.rnlib.RNHcePackage; to the imports at the top of the file
Add new RNHcePackage() to the list returned by the getPackages() method
Append the following lines to android/settings.gradle: include ':react-native-hce' project(':react-native-hce').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-hce/android')
Insert the following lines inside the dependencies block in android/app/build.gradle: compile project(':react-native-hce')
The aid need to customize.
Open up android/app/src/main/AndroidManifest.xml
Add <uses-permission android:name="android.permission.NFC" />
Add <service android:name="studio.bb.rnlib.CardService" android:exported="true" android:permission="android.permission.BIND_NFC_SERVICE"> <intent-filter> <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE" /> </intent-filter> <meta-data android:name="android.nfc.cardemulation.host_apdu_service" android:resource="@xml/aid_list" /> </service>
Create aid_list.xml in android/app/src/main/res/xml/
Add code in aid_list.xml
Edit AID in react-native-nfc-hce/android/src/main/java/studio/bb/rnlib/CardService.java
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page