Browse Source

Update README.md

wkh237 9 years ago
parent
commit
29417d3735
1 changed files with 7 additions and 4 deletions
  1. 7
    4
      README.md

+ 7
- 4
README.md View File

304
 ```js
304
 ```js
305
 
305
 
306
 RNFetchBlog
306
 RNFetchBlog
307
+    .config({
308
+        // DCIMDir is in external storage
309
+        path : dirs.DCIMDir + '/music.mp3'
310
+    })
307
     .fetch('GET', 'http://example.com/music.mp3')
311
     .fetch('GET', 'http://example.com/music.mp3')
308
     .then((res) => RNFetchBlob.fs.scanFile([ { path : res.path(), mime : 'audio/mpeg' } ]))
312
     .then((res) => RNFetchBlob.fs.scanFile([ { path : res.path(), mime : 'audio/mpeg' } ]))
309
     .then(() => {
313
     .then(() => {
316
 
320
 
317
 If mime is null or undefined, then the mime type will be inferred from the file extension.
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
 ```js
327
 ```js
324
 RNFetchBlob.config({
328
 RNFetchBlob.config({
325
   fileCache : true,
329
   fileCache : true,
326
-  // android only options
330
+  // android only options, these options be a no-op on IOS
327
   addAndroidDownloads : {
331
   addAndroidDownloads : {
328
     // Show notification when response data transmitted
332
     // Show notification when response data transmitted
329
     notification : true,
333
     notification : true,
340
 .then(...)
344
 .then(...)
341
 ```
345
 ```
342
 
346
 
343
-
344
 #### File Access
347
 #### File Access
345
 
348
 
346
 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.
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.