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

Commit 96a93cc

Browse files
committed
Merge branch '0.10.3' into 0.11.0
2 parents 63bcc8d + edd5956 commit 96a93cc

39 files changed

+842
-247
lines changed

.github/ISSUE_TEMPLATE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Hi ! Thank you for reporting an issue, but we would like to remind you, we have a trouble shooting page in our wiki. You may want to take a look on that page or find issues tagged "trouble shooting" :p
1+
Hi ! Thank you for reporting an issue, but we would like to remind you, we have a trouble shooting page in our wiki.
2+
You may want to take a look on that page or find issues tagged "trouble shooting" :p
23

34
* please provide the version of installed library and RN project.
45
* a sample code snippet/repository is very helpful to spotting the problem.

.github/PULL_REQUEST_TEMPLATE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Thank you for making a pull request ! Just a gentle reminder :)
22

33
1. If the PR is offering a feature please make the request to our "Feature Branch" 0.11.0
4-
2. Bug fix request to "Bug Fix Branch" 0.10.1
4+
2. Bug fix request to "Bug Fix Branch" 0.10.2
55
3. Correct README.md can directly to master

CONTRIBUTORS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1+
12
Andreas Amsenius <[email protected]>
23
Arthur Ouaki <[email protected]>
34
Binur Konarbai <[email protected]>
45
Chris Sloey <[email protected]>
56
Corentin Smith <[email protected]>
67
Dmitry Petukhov <[email protected]>
8+
Dombi Soma Kristóf <[email protected]>
79
Erik Smartt <[email protected]>
810
Evgeniy Baraniuk <[email protected]>
911
Frank van der Hoek <[email protected]>
1012
Juan B. Rodriguez <[email protected]>
1113
14+
Martin Giachetti <[email protected]>
1215
Mike Monteith <[email protected]>
16+
Naoki AINOYA <[email protected]>
1317
Nguyen Cao Nhat Linh <[email protected]>
18+
Petter Hesselberg <[email protected]>
1419
Tim Suchanek <[email protected]>
1520
1621
francisco-sanchez-molina <[email protected]>

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
A project committed to make file acess and data transfer easier, efficient for React Native developers.
66

7-
> If you're going to use github repo as npm dependency please use the [archive repository](https://github.com/wkh237/react-native-fetch-blob-package/releases/tag/v0.9.6).
7+
> If you're going to use github repo as npm dependency please visit the [archive repository](https://github.com/wkh237/react-native-fetch-blob-package/releases/tag/v0.9.6).
88
9-
> If you're using this library as Firebase Storage solution, please upgrade to 0.9.6 since XMLHttpRequest polyfill has way better compatibility than previous versions.
9+
> For Firebase Storage solution, please upgrade to latest version for best compatibility.
1010
1111
## Features
1212
- Transfer data directly from/to storage without BASE64 bridging
1313
- File API supports normal files, Asset files, and CameraRoll files
1414
- Native-to-native file manipulation API, reduce JS bridging performance loss
1515
- File stream support for dealing with large file
1616
- Blob, File, XMLHttpRequest polyfills that make browser-based library available in RN (experimental)
17-
- JSON stream supported base on [Oboe.js@jimhigson](https://github.com/jimhigson/oboe.js/)
17+
- JSON stream supported base on [Oboe.js](https://github.com/jimhigson/oboe.js/) @jimhigson
1818

1919
## TOC
2020
* [About](#user-content-about)
@@ -608,10 +608,10 @@ When calling `readStream` method, you have to `open` the stream, and start to re
608608
```js
609609
let data = ''
610610
RNFetchBlob.fs.readStream(
611-
// encoding, should be one of `base64`, `utf8`, `ascii`
612-
'base64',
613611
// file path
614612
PATH_TO_THE_FILE,
613+
// encoding, should be one of `base64`, `utf8`, `ascii`
614+
'base64',
615615
// (optional) buffer size, default to 4096 (4095 for BASE64 encoded data)
616616
// when reading file in BASE64 encoding, buffer size must be multiples of 3.
617617
4095)

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "react-native-fetch-blob-dev-env",
33
"description": "RNFB development environment, not dist package",
4-
"version": "0.10.1-dev",
4+
"version": "0.10.3-dev",
55
"private": true,
66
"scripts": {
77
"start": "node node_modules/react-native/local-cli/cli.js start",
88
"update-info": "sh scripts/contributors.sh",
9-
"test": "sh ./scrips/test.sh"
9+
"test": "sh ./scripts/test.sh"
1010
},
1111
"devDependencies": {
1212
"body-parser": "^1.15.0",
@@ -16,19 +16,24 @@
1616
"multer": "^1.1.0"
1717
},
1818
"contributors": [
19+
"960px <[email protected]>",
1920
"Andreas Amsenius <[email protected]>",
2021
"Arthur Ouaki <[email protected]>",
2122
"Binur Konarbai <[email protected]>",
2223
"Chris Sloey <[email protected]>",
2324
"Corentin Smith <[email protected]>",
2425
"Dmitry Petukhov <[email protected]>",
26+
"Dombi Soma Kristóf <[email protected]>",
2527
"Erik Smartt <[email protected]>",
2628
"Evgeniy Baraniuk <[email protected]>",
2729
"Frank van der Hoek <[email protected]>",
2830
"Juan B. Rodriguez <[email protected]>",
2931
"Kaishley <[email protected]>",
32+
"Martin Giachetti <[email protected]>",
3033
"Mike Monteith <[email protected]>",
34+
"Naoki AINOYA <[email protected]>",
3135
"Nguyen Cao Nhat Linh <[email protected]>",
36+
"Petter Hesselberg <[email protected]>",
3237
"Tim Suchanek <[email protected]>",
3338
"follower <[email protected]>",
3439
"francisco-sanchez-molina <[email protected]>",

src/CONTRIBUTORS.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Andreas Amsenius <[email protected]>
3+
Arthur Ouaki <[email protected]>
4+
Binur Konarbai <[email protected]>
5+
Chris Sloey <[email protected]>
6+
Corentin Smith <[email protected]>
7+
Dmitry Petukhov <[email protected]>
8+
Dombi Soma Kristóf <[email protected]>
9+
Erik Smartt <[email protected]>
10+
Evgeniy Baraniuk <[email protected]>
11+
Frank van der Hoek <[email protected]>
12+
Juan B. Rodriguez <[email protected]>
13+
14+
Martin Giachetti <[email protected]>
15+
Mike Monteith <[email protected]>
16+
Naoki AINOYA <[email protected]>
17+
Nguyen Cao Nhat Linh <[email protected]>
18+
Petter Hesselberg <[email protected]>
19+
Tim Suchanek <[email protected]>
20+
21+
francisco-sanchez-molina <[email protected]>
22+
23+
kejinliang <[email protected]>
24+
pedramsaleh <[email protected]>
25+

src/android.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2016 wkh237@github. All rights reserved.
22
// Use of this source code is governed by a MIT-style license that can be
33
// found in the LICENSE file.
4-
// @flow
54

65
import {
76
NativeModules,

src/android/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
package="com.RNFetchBlob">
33

44
<application
5-
android:allowBackup="true"
65
android:label="@string/app_name"
76
android:supportsRtl="true">
87

src/android/src/main/java/com/RNFetchBlob/RNFetchBlob.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.facebook.react.bridge.ReadableArray;
1515
import com.facebook.react.bridge.ReadableMap;
1616
import com.facebook.react.bridge.WritableArray;
17+
import com.facebook.react.bridge.WritableMap;
1718

1819
import java.util.Map;
1920
import java.util.concurrent.LinkedBlockingQueue;
@@ -231,17 +232,32 @@ public void run() {
231232
@ReactMethod
232233
/**
233234
* Get cookies belongs specific host.
234-
* @param host String host name.
235+
* @param host String domain name.
235236
*/
236-
public void getCookies(String host, Promise promise) {
237+
public void getCookies(String domain, Promise promise) {
237238
try {
238-
WritableArray cookies = RNFBCookieJar.getCookies(host);
239+
WritableMap cookies = RNFBCookieJar.getCookies(domain);
239240
promise.resolve(cookies);
240241
} catch(Exception err) {
241242
promise.reject("RNFetchBlob.getCookies", err.getMessage());
242243
}
243244
}
244245

246+
@ReactMethod
247+
/**
248+
* Remove cookies for specific domain
249+
* @param domain String of the domain
250+
* @param promise JSC promise injected by RN
251+
*/
252+
public void removeCookies(String domain, Promise promise) {
253+
try {
254+
RNFBCookieJar.removeCookies(domain);
255+
promise.resolve(null);
256+
} catch(Exception err) {
257+
promise.reject("RNFetchBlob.removeCookies", err.getMessage());
258+
}
259+
}
260+
245261
@ReactMethod
246262
/**
247263
* @param path Stream file path

src/android/src/main/java/com/RNFetchBlob/RNFetchBlobConfig.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class RNFetchBlobConfig {
1919
public Boolean overwrite = true;
2020
public long timeout = 60000;
2121
public Boolean increment = false;
22+
public Boolean followRedirect = true;
2223
public ReadableArray binaryContentTypes = null;
2324

2425
RNFetchBlobConfig(ReadableMap options) {
@@ -36,9 +37,11 @@ public class RNFetchBlobConfig {
3637
if(this.path != null && path.toLowerCase().contains("?append=true")) {
3738
this.overwrite = false;
3839
}
39-
4040
if(options.hasKey("overwrite"))
4141
this.overwrite = options.getBoolean("overwrite");
42+
if(options.hasKey("followRedirect")) {
43+
this.followRedirect = options.getBoolean("followRedirect");
44+
}
4245
this.key = options.hasKey("key") ? options.getString("key") : null;
4346
this.mime = options.hasKey("contentType") ? options.getString("contentType") : null;
4447
this.increment = options.hasKey("increment") ? options.getBoolean("increment") : false;

0 commit comments

Comments
 (0)