How to use the react-native-nfc-manager.MIFARE_BLOCK_SIZE function in react-native-nfc-manager

To help you get started, we’ve selected a few react-native-nfc-manager examples, based on popular ways it is used in public projects.

github whitedogg13 / react-native-nfc-manager / example / AndroidMifareClassic.js View on Github external
.then(block => {
          // Create 1 block
          let data = [];
          for (let i = 0; i < NfcManager.MIFARE_BLOCK_SIZE; i++) {
            data.push(0);
          }

          // Fill the block with our text, but don't exceed the block size
          for (let i = 0; i < this.state.textToWrite.length && i < NfcManager.MIFARE_BLOCK_SIZE; i++) {
            data[i] = parseInt(this.state.textToWrite.charCodeAt(i));
          }

          return NfcManager.mifareClassicWriteBlock(block, data);
        })
        .then(read)
github whitedogg13 / react-native-nfc-manager / example / AndroidMifareClassic.js View on Github external
.then(block => {
          // Create 1 block
          let data = [];
          for (let i = 0; i < NfcManager.MIFARE_BLOCK_SIZE; i++) {
            data.push(0);
          }

          // Fill the block with our text, but don't exceed the block size
          for (let i = 0; i < this.state.textToWrite.length && i < NfcManager.MIFARE_BLOCK_SIZE; i++) {
            data[i] = parseInt(this.state.textToWrite.charCodeAt(i));
          }

          return NfcManager.mifareClassicWriteBlock(block, data);
        })
        .then(read)