Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 83651dd

Browse files
committed
Merge branch 'master' into 0.6.3
2 parents 9f888ce + 7b09486 commit 83651dd

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

README.md

+27-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# react-native-fetch-blob [![npm](https://img.shields.io/npm/v/react-native-fetch-blob.svg?style=flat-square)](https://www.npmjs.com/package/react-native-fetch-blob) ![](https://img.shields.io/badge/PR-Welcome-brightgreen.svg?style=flat-square) [![npm](https://img.shields.io/npm/l/express.svg?maxAge=2592000&style=flat-square)]() [![npm](https://img.shields.io/badge/inProgress-0.7.0-yellow.svg?style=flat-square)](https://github.com/wkh237/react-native-fetch-blob/milestones)
1+
# react-native-fetch-blob ![release](https://img.shields.io/github/release/wkh237/react-native-fetch-blob.svg?maxAge=86400&style=flat-square) [![npm](https://img.shields.io/npm/v/react-native-fetch-blob.svg?style=flat-square)](https://www.npmjs.com/package/react-native-fetch-blob) ![](https://img.shields.io/badge/PR-Welcome-brightgreen.svg?style=flat-square) [![npm](https://img.shields.io/npm/l/express.svg?maxAge=2592000&style=flat-square)]() [![npm](https://img.shields.io/badge/inProgress-0.7.0-yellow.svg?style=flat-square)](https://github.com/wkh237/react-native-fetch-blob/milestones)
22

33
A module provides upload, download, and files access API. Supports file stream read/write for process large files.
44

@@ -44,11 +44,31 @@ Link package using [rnpm](https://github.com/rnpm/rnpm)
4444
rnpm link
4545
```
4646

47+
### For React Native >= 0.29
48+
49+
The Android application template has changed in [[email protected]](https://github.com/facebook/react-native/releases/tag/v0.29.0) our rnpm link script may not working properly, if you encounters some error, please follow these instructions, Thanks @dphov, also see related issue [#51](https://github.com/wkh237/react-native-fetch-blob/issues/51)
50+
51+
Add this code to `MainApplication.java`
52+
53+
```diff
54+
...
55+
+ import com.RNFetchBlob.RNFetchBlobPackage;
56+
...
57+
protected List<ReactPackage> getPackages() {
58+
return Arrays.<ReactPackage>asList(
59+
new MainReactPackage(),
60+
+ new RNFetchBlobPackage()
61+
);
62+
}
63+
};
64+
...
65+
```
66+
4767
**Grant Permission to External storage for Android 5.0 or lower**
4868

49-
Mechanism about granting Android permissions has slightly different since Android 6.0 released, please refer to [Officail Document](https://developer.android.com/training/permissions/requesting.html).
69+
Mechanism about granting Android permissions has slightly different since Android 6.0 released, please refer to [Official Document](https://developer.android.com/training/permissions/requesting.html).
5070

51-
If you're going to access external storage (say, SD card storage) for `Android 5.0` (or lower) devices, you might have to add the following line to `AndroidManifetst.xml`.
71+
If you're going to access external storage (say, SD card storage) for `Android 5.0` (or lower) devices, you might have to add the following line to `AndroidManifest.xml`.
5272

5373
```diff
5474
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
@@ -110,7 +130,7 @@ RNFetchBlob.fetch('GET', 'http://www.example.com/images/img1.png', {
110130

111131
#### Download to storage directly
112132

113-
The simplest way is give a `fileCach` option to config, and set it to `true`. This will let the incoming response data stored in a temporary path **wihout** any file extension.
133+
The simplest way is give a `fileCache` option to config, and set it to `true`. This will let the incoming response data stored in a temporary path **without** any file extension.
114134

115135
**These files won't be removed automatically, please refer to [Cache File Management](#user-content-cache-file-management)**
116136

@@ -149,7 +169,7 @@ RNFetchBlob
149169
console.log('The file saved to ', res.path())
150170
// Beware that when using a file path as Image source on Android,
151171
// you must prepend "file://"" before the file path
152-
imageView = <Image source={{ uri : Platform.OS === 'android' ? 'file://' : '' + res.path() }}/>
172+
imageView = <Image source={{ uri : Platform.OS === 'android' ? 'file://' + res.path() : '' + res.path() }}/>
153173
})
154174
```
155175

@@ -297,7 +317,7 @@ What if you want to upload a file in some field ? Just like [upload a file from
297317

298318
#### Upload/Download progress
299319

300-
In `version >= 0.4.2` it is possible to know the upload/download progress. On Anroid, only download progress is supported. See [wiki](https://github.com/wkh237/react-native-fetch-blob/wiki/Fetch-API#fetchprogresseventlistenerpromisernfetchblobresponse) for more information.
320+
In `version >= 0.4.2` it is possible to know the upload/download progress. On Android, only download progress is supported. See [wiki](https://github.com/wkh237/react-native-fetch-blob/wiki/Fetch-API#fetchprogresseventlistenerpromisernfetchblobresponse) for more information.
301321

302322
```js
303323
RNFetchBlob.fetch('POST', 'http://www.example.com/upload', {
@@ -401,7 +421,7 @@ RNFetchBlob.config({
401421

402422
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 we realized that, it's hard to find a great solution to manage cached files, every one who use this moudle may need these APIs for there cases.
403423

404-
Before get started using file APIs we recommend read [Differences between File Source](https://github.com/wkh237/react-native-fetch-blob/wiki/File-System-Access-API#differences-between-file-source) first.
424+
Before start using file APIs, we recommend read [Differences between File Source](https://github.com/wkh237/react-native-fetch-blob/wiki/File-System-Access-API#differences-between-file-source) first.
405425

406426
File Access APIs
407427
- [asset (0.6.2)](https://github.com/wkh237/react-native-fetch-blob/wiki/File-System-Access-API#assetfilenamestringstring)

0 commit comments

Comments
 (0)