I am trying to have a card emulation which does ;
import React from 'react';
import { View, Text, StyleSheet, Button } from 'react-native';
import { HceTools } from 'react-native-nfc-sdk';
export default function App () {
const hce = new HceTools();
const [isTagRead, setIsTagRead] = React.useState('No');
const emulate = () => {
hce.startEmulation(
{content: 'Hello World!', writable: false},
() => {
setTagIsRead('Yes!');
setTimeout(() => setIsTagRead('No'), 5000);
}
)
}
return (
<View>
<Button onPress={emulate} title="EMULATE NFC TAG" />
<Text>Was the tag read? {isTagRead}</Text>
</View>
);
}
I tried the block code but it did not respond
Try to use this library for HCE emulation https://github.com/appidea/react-native-hce.