Pilloxa / react-native-nordic-dfu

Nordic Device Firmware Update for React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Firmware File not found - iOS

suryakant-patil opened this issue · comments

HI,
I am getting the error after starting the DFU process for firmware file not found.
I have confirmed the firmware file is attached to the process.
Please help me to resolve above issue on iOS

React Native version: 0.63.3

@suryakant-patil Did you find a solution to this?

@Nickolans, not yet. Sometimes it works, and sometimes it does not.

@suryakant-patil try like this:

const destination = `${RNFS.DocumentDirectoryPath}/installationFile.zip`;
const exists = await RNFS.exists(destination);
exists && (await RNFS.unlink(destination));
const response = await ReactNativeBlobUtil.config({
  fileCache: true,
  appendExt: 'zip',
}).fetch('GET', firmwareUrl);

const downloadPath = response.path();
await RNFS.copyFile(downloadPath, destination);
response?.flush();

NordicDFU.startDFU({
  deviceAddress: device.id,
  name: device.advertising.localName,
  filePath:
    Platform.OS === 'ios'
      ? `file://${destination}`
      : destination
      });