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

Commit 327c8cc

Browse files
authored
Merge pull request #209 from openmynet/patch-1
Patch 1
2 parents f4a6b6c + 4bfba6c commit 327c8cc

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
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.

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 0.10.1-beta.1 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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",

src/ios/RNFetchBlob/RNFetchBlob.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,9 @@ - (NSDictionary *)constantsToExport
440440

441441
RCT_EXPORT_METHOD(previewDocument:(NSString*)uri scheme:(NSString *)scheme resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject
442442
{
443-
444-
NSURL * url = [[NSURL alloc] initWithString:uri];
443+
NSString * utf8uri = [uri stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
444+
NSURL * url = [[NSURL alloc] initWithString:utf8uri];
445+
// NSURL * url = [[NSURL alloc] initWithString:uri];
445446
documentController = [UIDocumentInteractionController interactionControllerWithURL:url];
446447
UIViewController *rootCtrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
447448
documentController.delegate = self;
@@ -459,8 +460,9 @@ - (NSDictionary *)constantsToExport
459460

460461
RCT_EXPORT_METHOD(openDocument:(NSString*)uri scheme:(NSString *)scheme resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject
461462
{
462-
463-
NSURL * url = [[NSURL alloc] initWithString:uri];
463+
NSString * utf8uri = [uri stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
464+
NSURL * url = [[NSURL alloc] initWithString:utf8uri];
465+
// NSURL * url = [[NSURL alloc] initWithString:uri];
464466
documentController = [UIDocumentInteractionController interactionControllerWithURL:url];
465467
documentController.delegate = self;
466468

0 commit comments

Comments
 (0)