Browse Source

Merge branch '0.9.0' of github.com:wkh237/react-native-fetch-blob into 0.9.0

Ben Hsieh 8 years ago
parent
commit
cda9a6f48d
1 changed files with 36 additions and 2 deletions
  1. 36
    2
      README.md

+ 36
- 2
README.md View File

9
 - File stream support for dealing with large file
9
 - File stream support for dealing with large file
10
 - Blob, File, XMLHttpRequest polyfills that make browser-based library available in RN (experimental)
10
 - Blob, File, XMLHttpRequest polyfills that make browser-based library available in RN (experimental)
11
 
11
 
12
+
12
 ## TOC
13
 ## TOC
13
 * [About](#user-content-about)
14
 * [About](#user-content-about)
14
 * [Installation](#user-content-installation)
15
 * [Installation](#user-content-installation)
38
 
39
 
39
 In `0.8.0` we introduced experimential Web API polyfills that make it possible to use browser-based libraries in React Native, for example, [FireBase JS SDK](https://github.com/wkh237/rn-firebase-storage-upload-sample)
40
 In `0.8.0` we introduced experimential Web API polyfills that make it possible to use browser-based libraries in React Native, for example, [FireBase JS SDK](https://github.com/wkh237/rn-firebase-storage-upload-sample)
40
 
41
 
42
+
41
 ## Installation
43
 ## Installation
42
 
44
 
43
 Install package from npm
45
 Install package from npm
493
 .then(...)
495
 .then(...)
494
 ```
496
 ```
495
 
497
 
498
+**Open Downloaded File with Intent**
499
+
500
+This is a new feature added in `0.9.0`, if you're going to open a file path using official [Linking](https://facebook.github.io/react-native/docs/linking.html) API that might not work as expected, also, if you're going to install an APK in `Downloads` app, that will not work too. As an alternative, you can try `actionViewIntent` API, which will send an ACTION_VIEW intent for you which uses the given `MIME` type.
501
+
502
+Download and install an APK programatically
503
+
504
+```js
505
+
506
+const android = RNFetchBlob.android
507
+
508
+RNFetchBlob.config({
509
+    addAndroidDownloads : {
510
+      useDownloadManager : true,
511
+      title : 'awesome.apk',
512
+      description : 'An APK that will be installed',
513
+      mime : 'application/vnd.android.package-archive',
514
+      mediaScannable : true,
515
+      notification : true,
516
+    }
517
+  })
518
+  .fetch('GET', `http://www.example.com/awesome.apk`)
519
+  .then((res) => {
520
+      android.actionViewIntent(res.path(), 'application/vnd.android.package-archive')
521
+  })
522
+```
523
+
524
+Or show an image in image viewer
525
+
526
+```js
527
+      android.actionViewIntent(PATH_OF_IMG, 'image/png')
528
+```
529
+
496
 ### File System
530
 ### File System
497
 
531
 
498
 #### File Access
532
 #### File Access
645
 
679
 
646
 ### Web API Polyfills
680
 ### Web API Polyfills
647
 
681
 
648
-After `0.8.0` we've made some [Web API polyfills](https://github.com/wkh237/react-native-fetch-blob/wiki/Web-API-Polyfills-(work-in-progress)) that makes some browser-based library available in RN.
682
+After `0.8.0` we've made some [Web API polyfills](https://github.com/wkh237/react-native-fetch-blob/wiki/Web-API-Polyfills-(experimental)) that makes some browser-based library available in RN.
649
 
683
 
650
 - Blob
684
 - Blob
651
 - XMLHttpRequest (Use our implementation if you're going to use it with Blob)
685
 - XMLHttpRequest (Use our implementation if you're going to use it with Blob)
676
 
710
 
677
 | Version | |
711
 | Version | |
678
 |---|---|
712
 |---|---|
679
-| 0.8.2 | Fix Android RN 0.31 installation issue #78 |
713
+| 0.9.0 | Fix unicode response data format issue #73. Improve Android performance by using thread pool instead of async task. Add Fetch replacement #70. Add Android only API `actionViewIntent` to open file or install APK in app |
680
 | 0.8.1 | Remove Web API log and fix ios progress report function. |
714
 | 0.8.1 | Remove Web API log and fix ios progress report function. |
681
 | 0.8.0 | Added Web API polyfills, support regular request, added timeout option. |
715
 | 0.8.0 | Added Web API polyfills, support regular request, added timeout option. |
682
 | 0.7.5 | Fix installation script that make it compatible to react-native < 0.28 |
716
 | 0.7.5 | Fix installation script that make it compatible to react-native < 0.28 |