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

Patch 1 #209

Merged
merged 6 commits into from
Dec 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
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
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

* please provide the version of installed library and RN project.
* a sample code snippet/repository is very helpful to spotting the problem.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

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

> 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).
> 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).

> 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.
> For Firebase Storage solution, please upgrade to 0.10.1-beta.1 for best compatibility.

## Features
- Transfer data directly from/to storage without BASE64 bridging
- File API supports normal files, Asset files, and CameraRoll files
- Native-to-native file manipulation API, reduce JS bridging performance loss
- File stream support for dealing with large file
- Blob, File, XMLHttpRequest polyfills that make browser-based library available in RN (experimental)
- JSON stream supported base on [Oboe.js@jimhigson](https://github.com/jimhigson/oboe.js/)
- JSON stream supported base on [Oboe.js](https://github.com/jimhigson/oboe.js/) @jimhigson

## TOC
* [About](#user-content-about)
Expand Down Expand Up @@ -608,10 +608,10 @@ When calling `readStream` method, you have to `open` the stream, and start to re
```js
let data = ''
RNFetchBlob.fs.readStream(
// encoding, should be one of `base64`, `utf8`, `ascii`
'base64',
// file path
PATH_TO_THE_FILE,
// encoding, should be one of `base64`, `utf8`, `ascii`
'base64',
// (optional) buffer size, default to 4096 (4095 for BASE64 encoded data)
// when reading file in BASE64 encoding, buffer size must be multiples of 3.
4095)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"update-info": "sh scripts/contributors.sh",
"test": "sh ./scrips/test.sh"
"test": "sh ./scripts/test.sh"
},
"devDependencies": {
"body-parser": "^1.15.0",
Expand Down
10 changes: 6 additions & 4 deletions src/ios/RNFetchBlob/RNFetchBlob.m
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,9 @@ - (NSDictionary *)constantsToExport

RCT_EXPORT_METHOD(previewDocument:(NSString*)uri scheme:(NSString *)scheme resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject
{

NSURL * url = [[NSURL alloc] initWithString:uri];
NSString * utf8uri = [uri stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL * url = [[NSURL alloc] initWithString:utf8uri];
// NSURL * url = [[NSURL alloc] initWithString:uri];
documentController = [UIDocumentInteractionController interactionControllerWithURL:url];
UIViewController *rootCtrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
documentController.delegate = self;
Expand All @@ -459,8 +460,9 @@ - (NSDictionary *)constantsToExport

RCT_EXPORT_METHOD(openDocument:(NSString*)uri scheme:(NSString *)scheme resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject
{

NSURL * url = [[NSURL alloc] initWithString:uri];
NSString * utf8uri = [uri stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL * url = [[NSURL alloc] initWithString:utf8uri];
// NSURL * url = [[NSURL alloc] initWithString:uri];
documentController = [UIDocumentInteractionController interactionControllerWithURL:url];
documentController.delegate = self;

Expand Down