You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -475,6 +476,34 @@ If you have existing code that uses `whatwg-fetch`(the official **fetch**), it's
475
476
476
477
[See document and examples](https://github.com/joltup/rn-fetch-blob/wiki/Fetch-API#fetch-replacement)
477
478
479
+
### iOS Background Uploading
480
+
Normally, iOS interrupts network connections when an app is moved to the background, and will throw an error 'Lost connection to background transfer service' when the app resumes. To continue the upload of large files even when the app is in the background, you will need to enable IOSUploadTask options.
481
+
482
+
First add the following property to your AppDelegate.h:
The following example shows how to upload a file in the background:
495
+
```js
496
+
RNFetchBlob
497
+
.config({
498
+
IOSBackgroundTask:true, // required for both upload
499
+
IOSUploadTask:true, // Use instead of IOSDownloadTask if uploading
500
+
uploadFilePath :'file://'+ filePath
501
+
})
502
+
.fetch('PUT', url, {
503
+
'Content-Type': mediaType
504
+
}, RNFetchBlob.wrap(filePath));
505
+
```
506
+
478
507
### Android Media Scanner, and Download Manager Support
479
508
480
509
If you want to make a file in `External Storage` becomes visible in Picture, Downloads, or other built-in apps, you will have to use `Media Scanner` or `Download Manager`.
0 commit comments