|
|
|
|
4
|
|
4
|
|
5
|
## TOC
|
5
|
## TOC
|
6
|
* [About](#user-content-about)
|
6
|
* [About](#user-content-about)
|
7
|
-* [Backward Compatible](#user-content-backward-compatible)
|
|
|
8
|
* [Installation](#user-content-installation)
|
7
|
* [Installation](#user-content-installation)
|
9
|
* [Recipes](#user-content-recipes)
|
8
|
* [Recipes](#user-content-recipes)
|
10
|
* [Download file](#user-content-download-example--fetch-files-that-needs-authorization-token)
|
9
|
* [Download file](#user-content-download-example--fetch-files-that-needs-authorization-token)
|
|
|
|
|
27
|
|
26
|
|
28
|
Now, this project is committed to make file acess and transfer more easier and more effiecient for React Native developers. We've implemented lot of file access function which plays well with our network module. For example, it can upload and download data directly into/from file system, which is much more performant (especially for large ones) than converting data to BASE64 passing them around through React JS Bridge, also, file stream support so that you can read large file not causing OOM error.
|
27
|
Now, this project is committed to make file acess and transfer more easier and more effiecient for React Native developers. We've implemented lot of file access function which plays well with our network module. For example, it can upload and download data directly into/from file system, which is much more performant (especially for large ones) than converting data to BASE64 passing them around through React JS Bridge, also, file stream support so that you can read large file not causing OOM error.
|
29
|
|
28
|
|
30
|
-## Backward Compatible
|
|
|
31
|
-
|
|
|
32
|
-All updates are `backward-compatible` generally you don't have to change existing code unless you're going to use new APIs. But it's recommended pre `0.5.0` users consider upgrade the package to latest version, since we have introduced new APIs can either `upload` or `download` files simply using a file path. It's much more memory efficent in some use case. We've also introduced `fs` APIs for access files, and `file stream` API that helps you read/write files (especially for **large ones**), see [Examples](#user-content-recipes) bellow. This module implements native methods, supports both Android (uses same native library as offical RN fetch API [OkHttp](https://github.com/square/okhttp)) and IOS.
|
|
|
33
|
-
|
|
|
34
|
## Installation
|
29
|
## Installation
|
35
|
|
30
|
|
36
|
Install package from npm
|
31
|
Install package from npm
|
|
|
|
|
45
|
rnpm link
|
40
|
rnpm link
|
46
|
```
|
41
|
```
|
47
|
|
42
|
|
|
|
43
|
+### To Use 0.7.0+ you will need to upgrade your App to 0.27+ (Android)
|
|
|
44
|
+
|
|
|
45
|
+In `0.7.0` we have removed Android AsyncHttpClient dependency and use OkHttp3+ dependency in react-native, therefore older project (pre 0.27 versions use OkHttp2) will not be compatible. As for 0.29 projects, since rnpm link is broken in 0.29, it's recommended to upgrade too (otherwise you may need to manually link Android project).
|
|
|
46
|
+
|
|
|
47
|
+To upgrade your project
|
|
|
48
|
+
|
|
|
49
|
+```
|
|
|
50
|
+$ react-native upgrade
|
|
|
51
|
+```
|
|
|
52
|
+
|
|
|
53
|
+you will need run `rnpm link` again after upgrade.
|
|
|
54
|
+
|
|
|
55
|
+
|
48
|
### Manually link the package (Android)
|
56
|
### Manually link the package (Android)
|
49
|
|
57
|
|
50
|
If rnpm link command failed to link the package automatically, you might try manually link the package.
|
58
|
If rnpm link command failed to link the package automatically, you might try manually link the package.
|