1

I have problem with react native ble plx. I try to print the image screenshot from component using react native viewshot and then i convert those file to string base64 after that i try to print to my bluetooth third party devices. but it doesnt work. i follow documentation and try to find solution by googling and experiment but still. im stuck.

async print(text: string) {
    if (!connectedDevice) return;
    const file = await RNFS.readFile(text, 'base64').then((res) => {
      return res;
    });

bleManager
  .writeCharacteristicWithResponseForDevice(
    connectedDevice?.id,
    SerialServiceUUID,
    SerialCharacteristicUUID,
    file,
  )
  .then((resp) => {
    console.log('WRITE resp = ', resp);
  })
  .catch((err) => {
    console.log('WRITE err = ', err);
  });}

enter image description here

B001ᛦ
  • 2,036
  • 6
  • 23
  • 31
barungerti441
  • 113
  • 1
  • 2
  • 5

0 Answers0