|
@@ -304,6 +304,10 @@ If you want to make a file in `External Storage` becomes visible in Picture, Mis
|
304
|
304
|
```js
|
305
|
305
|
|
306
|
306
|
RNFetchBlog
|
|
307
|
+ .config({
|
|
308
|
+ // DCIMDir is in external storage
|
|
309
|
+ path : dirs.DCIMDir + '/music.mp3'
|
|
310
|
+ })
|
307
|
311
|
.fetch('GET', 'http://example.com/music.mp3')
|
308
|
312
|
.then((res) => RNFetchBlob.fs.scanFile([ { path : res.path(), mime : 'audio/mpeg' } ]))
|
309
|
313
|
.then(() => {
|
|
@@ -316,14 +320,14 @@ RNFetchBlog
|
316
|
320
|
|
317
|
321
|
If mime is null or undefined, then the mime type will be inferred from the file extension.
|
318
|
322
|
|
319
|
|
-**Download Notification and Visibiliy in Download App**
|
|
323
|
+**Download Notification and Visibiliy in Download App (Android Only)**
|
320
|
324
|
|
321
|
|
-Generally, when you store a file into
|
|
325
|
+If you want to download success notification or make the stored file visible like the above. You have to add some options to `config`.
|
322
|
326
|
|
323
|
327
|
```js
|
324
|
328
|
RNFetchBlob.config({
|
325
|
329
|
fileCache : true,
|
326
|
|
- // android only options
|
|
330
|
+ // android only options, these options be a no-op on IOS
|
327
|
331
|
addAndroidDownloads : {
|
328
|
332
|
// Show notification when response data transmitted
|
329
|
333
|
notification : true,
|
|
@@ -340,7 +344,6 @@ RNFetchBlob.config({
|
340
|
344
|
.then(...)
|
341
|
345
|
```
|
342
|
346
|
|
343
|
|
-
|
344
|
347
|
#### File Access
|
345
|
348
|
|
346
|
349
|
File access APIs were made when developing `v0.5.0`, which helping us write tests, and was not planned to be a part of this module. However I realized that, it's hard to find a great solution to manage cached files, every one who use this moudle may need those APIs for there cases.
|