Rn-fetch-blob: IOSBackgroundTask breaks downloads

Created on 12 Jul 2018  路  5Comments  路  Source: joltup/rn-fetch-blob

Is there anything else I need to do in order to get background tasks working on iOS, there's not really any documentation?

Downloading files works as expected without this option however fails to work if I set IOSBackgroundTask: true.

  • please provide the version of installed library and RN project.
    "react-native": "0.55.4",
    "react-native-fetch-blob": "^0.10.8",

  • a sample code snippet/repository is very helpful to spotting the problem.

   return RNFetchBlob
            .config({
                IOSBackgroundTask: true, //onProgress called if this is false
                path: toFile,
                overwrite: true,
                indicator: true,
            })
            .fetch('GET', fromUrl, {
                //some headers ..
            })
            .progress((written) => onProgress(_path,written))
            .then((res) => {
                API.log(`Downloaded ${fromUrl} to ${toFile}`)
            }).catch((err) => {
                API.log(`Error downloading ${fromUrl} to ${toFile}`, err)
                return err;
            })

Most helpful comment

same problem.

does anyone know a better library? this one seems poorly-supported.

All 5 comments

the exactly same thing is happening with me

Same here too. With IOSBackgroundTask: true or without, if app go to background the download stops. However, background download works well on Android.

Same problem like @PierreBresson

same problem.

does anyone know a better library? this one seems poorly-supported.

I am also having same issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

drewandre picture drewandre  路  4Comments

MJXin picture MJXin  路  5Comments

elliscwc picture elliscwc  路  4Comments

minh-dai picture minh-dai  路  3Comments

msqar picture msqar  路  4Comments