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

ios upload image should cut the charset=utf-8 in http request header #711

Open
wants to merge 283 commits into
base: 0.10.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
283 commits
Select commit Hold shift + click to select a range
0a638e3
update readme with new maintainers message
Traviskn Mar 22, 2018
fa38cd5
update README with correct directions for PRs
Traviskn Mar 25, 2018
7cebeaa
Merge branch '0.10.9' into exception_fixes
chrusart Mar 27, 2018
fb63db9
createFile methods with promises
Mar 27, 2018
01f38a4
Merge branch 'exception_fixes' of github.com:flatfox-ag/react-native-…
Mar 27, 2018
8fb92ba
Merge pull request #10 from klaasman/0.10.9
Traviskn Mar 28, 2018
b9172bb
Inform linter that we're handling android api versions correctly
jakst Mar 29, 2018
b41cfb7
Merge pull request #11 from Jakst/fix-lint-errors
Traviskn Mar 29, 2018
1f9a176
Merge pull request #8 from flatfox-ag/exception_fixes
Traviskn Apr 7, 2018
2599ae4
compatible with RN > 0.49
alzalabany Apr 11, 2018
3b0c7ad
response typo
ericmorgan1 May 10, 2018
5750b0f
revert readme
ericmorgan1 May 10, 2018
ff6a2a6
readme
ericmorgan1 May 10, 2018
c5de6f8
Reject promise by iOS openDocument when a file is not opened
gbasov May 10, 2018
dcd3aaa
Fix RNFetchBlobBody#getRequestStream method name
ataillefer May 15, 2018
cd1eb1e
Handle Android content URIs for upload
ataillefer May 15, 2018
853fed3
Fix typo: "Status" instead of "Statu"
Skn0tt May 30, 2018
393c668
Update README with proper status code handling
guimeira May 30, 2018
a88b59f
Solve Android security exposed app error
Jun 1, 2018
298a4de
fix class imports
Jun 1, 2018
c66788f
fix class import
Jun 1, 2018
a3cf145
Merge pull request #57 from guimeira/master
Traviskn Jun 2, 2018
0410466
Merge pull request #56 from Skn0tt/0.10.9
Traviskn Jun 2, 2018
614ef56
Merge pull request #17 from alzalabany/patch-2
Traviskn Jun 2, 2018
4c4c5ea
sometimes getExternalFilesDir returns null, and the app crashes in th…
poison Jun 4, 2018
c9b8b91
Merge pull request #62 from poison/master
Jun 7, 2018
4add857
Merge pull request #40 from ericmorgan1/master
Jun 7, 2018
3edacb8
Add manual linking instructions
milesmatthias Jun 11, 2018
d486a4f
Merge pull request #70 from milesmatthias/patch-1
Jun 12, 2018
b2b5f5c
No depracation warning on instantiating dirs
Jun 15, 2018
63432ae
Depracation comment in code
Jun 15, 2018
c7374e7
Depracated comment fix
Jun 15, 2018
69a662a
remove duplicate requiresMainQueueSetup declaration
Traviskn Jun 23, 2018
fe56a52
Merge pull request #58 from Auugustocesar/0.10.9
Traviskn Jun 23, 2018
20d1be4
Merge pull request #45 from ataillefer/0.10.9
Traviskn Jun 23, 2018
9cb0f14
Merge pull request #77 from flatfox-ag/0.10.9
Traviskn Jun 23, 2018
33d55c0
Merge pull request #41 from genabasov/0.10.9
Traviskn Jun 23, 2018
37b0ecf
remove obsolete PR template, moving to master based dev
Traviskn Jun 23, 2018
822f568
Merge branch '0.10.9'
Traviskn Jun 23, 2018
39dd24b
update package.json metadata
Traviskn Jun 23, 2018
581b334
0.10.9
Traviskn Jun 23, 2018
34176c5
Update README to reflect new package name
Traviskn Jun 23, 2018
5983f0c
update repo name in package.json
Traviskn Jun 23, 2018
5721cb7
rename missed occurrences of react-native-fetch-blob
Traviskn Jun 23, 2018
00144aa
0.10.10
Traviskn Jun 23, 2018
521e0c4
Fix notification value for android download Manager
vikas5914 Jun 26, 2018
a309cc5
Update rn-fetch-blob.podspec
Traviskn Jun 26, 2018
2a81f32
0.10.11
Jun 26, 2018
fb0c5f1
Merge pull request #87 from vikas5914/master
Traviskn Jul 11, 2018
6984edc
update README.md to inform the handle of cookies
fzyzcjy Jul 12, 2018
e253ad2
Fix installation via github instructions
milesmatthias Jul 12, 2018
5837361
Fixed file moving
Jul 13, 2018
56c44e4
Merge pull request #110 from turtlegood/dev
Traviskn Jul 13, 2018
b3ab50a
Merge pull request #112 from milesmatthias/patch-2
Traviskn Jul 13, 2018
41e1572
Merge pull request #114 from ihavenoface5/FileMoving
Traviskn Jul 13, 2018
4800935
Added check for failing to create the output directory
Jul 16, 2018
5094579
Fixed truncating of progress report values.
Jul 16, 2018
4f66c84
Added null and path key check on addCompleteDownload method
Jul 17, 2018
ebc320f
Merge pull request #121 from ihavenoface5/ReadableMapNullCheck
Traviskn Jul 17, 2018
9ac9c6f
Merge pull request #118 from ihavenoface5/TaskProgress
Traviskn Jul 17, 2018
f1b8694
Merge pull request #117 from ihavenoface5/FileMoving
Traviskn Jul 17, 2018
1ebb03b
Removed output directory check / create. Fixes file moving.
Jul 17, 2018
948a2b9
Merge pull request #123 from ihavenoface5/FileMoving
Traviskn Jul 18, 2018
073cc3c
0.10.12
Jul 18, 2018
c31cb90
change android request builder so it wont set Content-Type header to …
LorienHW Jul 20, 2018
1a315a3
Fixed trusty example calling `then` instead of `fetch`
tales-aparecida Jul 23, 2018
a4abef9
improvement way to get root SDK versions
yeomann Jul 24, 2018
1663c7b
Merge pull request #127 from thalelinh/master
Traviskn Jul 26, 2018
27dc243
(small fix) Fix link to issue which was giving 404
azizhk Jul 27, 2018
d09c5d8
Update README.md with tip on project references
Jul 27, 2018
8f8c4a4
Merge pull request #1 from jschoolcraft/docs-upgrade-notice
Jul 27, 2018
840ddce
fix double quotes
yeomann Aug 4, 2018
c563262
Merge pull request #129 from yeomann/patch-1
Traviskn Aug 6, 2018
314f5f7
Merge pull request #133 from jschoolcraft/master
Traviskn Aug 6, 2018
eb0bfa4
Merge pull request #132 from azizhk/patch-1
Traviskn Aug 6, 2018
981627e
Merge pull request #126 from LorienHW/master
Traviskn Aug 6, 2018
e6e27ac
Fix RuntimeException
fiznool Aug 15, 2018
5551d01
fix progress and uploadprogress not callback in iOS
Aug 20, 2018
ebbf54e
Merge pull request #155 from yurnery/master
Traviskn Aug 21, 2018
d075673
Merge pull request #149 from studiozeffa/fix/cp-illegal-callback-invo…
Traviskn Aug 21, 2018
61a343e
path sent to unlink is now checked for file prefix.
Aug 21, 2018
fd81e46
0.10.13
Traviskn Aug 24, 2018
c95ef1c
Merge pull request #158 from ihavenoface5/issue-157
Traviskn Sep 14, 2018
b4e15f3
Create index.d.ts
reilem Sep 14, 2018
3aec419
support upload task + recieve finish event from background
Sep 20, 2018
9c76911
upload task - check if upload file exists
Oct 2, 2018
8d06e9c
fix file exists check
Oct 2, 2018
2cbc85b
Merge remote-tracking branch 'upstream/master'
Oct 3, 2018
c01e158
Update README.md
blankg Oct 3, 2018
d69c72b
Merge pull request #198 from capriza/master
Traviskn Oct 9, 2018
ba11d32
Merge pull request #184 from reilem/add-types
Traviskn Oct 9, 2018
8bc5ceb
index.d.ts: Fix extends -> implements
jdanbrown Oct 15, 2018
70fcb3a
Merge pull request #209 from jdanbrown/patch-1
Traviskn Nov 2, 2018
d6d5372
Update provider_paths.xml to allow access to cache
Jacse Nov 20, 2018
39c0c0f
Add flow type definitions
alpha0010 Dec 6, 2018
f4acab9
update android build config for newer react-native versions
Traviskn Dec 12, 2018
b94e9ff
Merge pull request #265 from joltup/gradle-upgrade
Traviskn Dec 12, 2018
4740be4
Merge pull request #256 from alpha0010/patch-1
Traviskn Dec 12, 2018
9ed5dcb
0.10.14
Traviskn Dec 12, 2018
ca4bf4e
Revert "Merge pull request #198 from capriza/master"
Traviskn Dec 22, 2018
d8c79f6
0.10.15
Traviskn Dec 22, 2018
574febb
Add RNFetchblob.fs.hash function to type definition
vunyunt Jan 4, 2019
b48f0e7
Added return type for RNFetchblob.fs.hash typedef
vunyunt Jan 4, 2019
e816b02
upgrading to sdk 28 and androidx
gla5001 Jan 24, 2019
e83f84f
upgrading to sdk 28 and androidx
gla5001 Jan 24, 2019
1a9d1bc
require cycle
suther Jan 24, 2019
27768f4
build fix
gla5001 Jan 24, 2019
24683eb
Solve the conflict between FileProvider and other libraries
1uokun Feb 7, 2019
9ae0289
specify react-native link module in readme
reed-jones Feb 8, 2019
24abf39
Updated for iOS
juniorojha Feb 21, 2019
c5f9a66
Fix error message on `mkdir` function
JediahDizon Feb 23, 2019
ede920c
Fixing #236 which did not expect null from DownloadManager.query()
mtolmacs Mar 2, 2019
0b47f3d
Add the FLAG_ACTIVITY_NEW_TASK flag.
wakeless Mar 7, 2019
56fedad
Fix fs.dirs api on iOS
alpha0010 Mar 8, 2019
831092a
Fix crash when streaming file with Arabic chars
mjmasn Apr 30, 2019
51b50f2
Fix crash on HTTP response containing Arabic chars
mjmasn Apr 30, 2019
bfc51af
Remove unused imports
mjmasn Apr 30, 2019
b7c5e94
Remove unused and deprecated AsyncStorage import
jrapala May 2, 2019
be168c3
info() method definition for FetchBlobResponse
May 6, 2019
dbed840
Update Fetch.js
nadav2051 Jun 3, 2019
da40583
Cancel download throw error bugfix (Android)
CapitanRedBeard Jun 14, 2019
7420183
Intent.FLAG_ACTIVITY_NEW_TASK added
alex-connecteam Jun 27, 2019
f836385
Bug fix for download interruption promise rejection
Jul 7, 2019
01f10cb
fix cocoa pod 0.60.0
congnguyen91 Jul 8, 2019
0f6c3e3
- use dependency React-Core instead React - though It worked
congnguyen91 Jul 10, 2019
432de9f
Merge pull request #354 from jrapala/hotfix/removeAsyncImport
Traviskn Jul 14, 2019
1c2e437
Merge pull request #397 from congnguyen91/master
Traviskn Jul 14, 2019
fb9e007
Merge pull request #291 from gla5001/androidx-upgrade
Traviskn Jul 14, 2019
6153af8
use android x file provider
Traviskn Jul 14, 2019
aee85fb
Merge branch 'master' into master
Traviskn Jul 14, 2019
9425ccb
Merge pull request #301 from 1uokun/master
Traviskn Jul 14, 2019
4339ac3
0.10.16
Traviskn Jul 14, 2019
baf0398
add version compatibility warning to README
Traviskn Jul 16, 2019
f13692a
convert to new react native config format
Traviskn Jul 19, 2019
085db09
Merge pull request #295 from suther/patch-4
Traviskn Jul 23, 2019
880bdc0
Fix REAME.me anchor
KrzysztofSakowski Jul 25, 2019
e51bdd1
add FLAG_ACTIVITY_NEW_TASK
Jul 30, 2019
95207a9
fix cannot import file from download folder in android
Jul 30, 2019
2528f3a
Merge pull request #1 from joltup/master
nadav2051 Jul 30, 2019
44add8c
Merge pull request #2 from cryptoalex/master
nadav2051 Jul 30, 2019
aca9058
Fix #170 - RNFetchBlob fs hash with md5 param fails if the file size …
ankit-eclat Aug 16, 2019
deb3588
Update RNFetchBlob.m
nadav2051 Aug 28, 2019
cd4e023
RNFetchBlobFS.writeFile(): ensure that files are closed properly in a…
mcuelenaere Sep 3, 2019
c98cff0
Create sync method to App Group dir
djorkaeffalexandre Sep 11, 2019
ee6b4cb
changed to chunk size instead of reading entire file
Sep 13, 2019
d40a563
Merge pull request #1 from heypinch/chore/fix-hash-mem
Sep 13, 2019
f882654
Merge pull request #418 from Crypho/Fix-Anroid-Issues-in-0-10-13
Traviskn Sep 26, 2019
356d731
Merge pull request #408 from joltup/convert-rnpm-to-config
Traviskn Sep 26, 2019
3361baa
Merge pull request #432 from mcuelenaere/fix/improve-io-error-handling
Traviskn Sep 26, 2019
d35fb73
Merge pull request #415 from KrzysztofSakowski/patch-1
Traviskn Sep 26, 2019
4305ef8
Merge pull request #396 from sonudoo/download-interruption-android-bu…
Traviskn Sep 26, 2019
104a94e
Merge pull request #381 from repodio/throw-on-cancel-android
Traviskn Sep 26, 2019
90ce0c4
Merge pull request #317 from ferocia/android-9-open-file
Traviskn Sep 26, 2019
6bbebd3
Merge pull request #353 from thinkproductivity/mjmasn-patch-1
Traviskn Sep 26, 2019
9a10735
Merge pull request #314 from plukkido/master
Traviskn Sep 26, 2019
e10f658
Merge pull request #308 from JediahDizon/master
Traviskn Sep 26, 2019
d1564d8
Merge pull request #356 from SychevSP/fix-ts-def-FetchBlobResponse
Traviskn Sep 26, 2019
df81a14
Merge pull request #319 from alpha0010/ios-fs-dirs
Traviskn Sep 26, 2019
a2395c0
Merge pull request #310 from juniorojha/master
Traviskn Sep 26, 2019
d173246
Merge pull request #436 from djorkaeffalexandre/sync.app-group
Traviskn Sep 26, 2019
eff4ae1
Merge pull request #303 from reed-jones/patch-1
Traviskn Sep 26, 2019
6e2234b
Merge pull request #276 from vunyunt/master
Traviskn Sep 26, 2019
86dc386
Merge pull request #239 from Jacse/cache-dir
Traviskn Sep 26, 2019
9a43620
Merge pull request #437 from heypinch/master
Traviskn Sep 26, 2019
5d477d9
0.11.0
Traviskn Sep 26, 2019
7b8be92
use package.json for versioning
Traviskn Sep 26, 2019
fb60952
0.11.1
Traviskn Sep 26, 2019
fc7ae6c
Merge branch 'master' of https://github.com/joltup/rn-fetch-blob into…
ankit-eclat Sep 26, 2019
00c12e3
Revert "Merge pull request #353 from thinkproductivity/mjmasn-patch-1"
Traviskn Sep 27, 2019
0e2c40e
Revert "Merge pull request #396 from sonudoo/download-interruption-an…
Traviskn Sep 27, 2019
9931f1e
0.11.2
Traviskn Sep 27, 2019
d03a502
Bug fix for download interruption promise rejection
susgup Sep 30, 2019
7ee256f
Fix errors in TypeScript typings
alpha0010 Oct 2, 2019
d490a3b
Merge pull request #449 from sonudoo/bug-fix-interrupted-downloads
Traviskn Oct 5, 2019
ec79195
Merge pull request #455 from alpha0010/patch-2
Traviskn Oct 5, 2019
b25baab
Merge pull request #423 from ankit-makwana/hash-fix
Traviskn Oct 5, 2019
66692b6
Fix #458 - Remove duped FLAG_ACTIVITY_NEW_TASK
jrapala Oct 10, 2019
ffc372e
Merge pull request #459 from jrapala/removeDupedAddFlags
Traviskn Oct 12, 2019
dd831a9
add missing methods to android static export in index.d.ts
jsamr Oct 17, 2019
61af1c7
Use non deprecated version of the method sslSocketFactory
xamoulin Oct 22, 2019
bfbfdfc
fixing the issue of translating the non english language data
sadafk831 Oct 30, 2019
bffd9e4
Fix comment: default timeout from 30000ms to 60000ms
set0gut1 Oct 31, 2019
7f8ec94
Update RNFetchBlob.java
nadav2051 Nov 19, 2019
3bbe72d
wifi only option, and missing typings.
cristianocca Nov 28, 2019
d7dd38f
Check if addAndroidDownloads map has notification key before consuming
Dec 10, 2019
52aa5ec
do not use P2P Wifi connections. Fixes issue on samsung
cristianocca Dec 11, 2019
99a81e5
take 2 at samsung issues: ensure network is connected
cristianocca Dec 11, 2019
3e3d36e
comment warning, too noisy on timeouts.
cristianocca Dec 12, 2019
8ee728e
undo these changes that were carried over from outdated master
cristianocca Dec 12, 2019
92a46a2
Use a friendlier error for download interrupts. Interrupts are normal…
cristianocca Dec 12, 2019
f2ac3e0
make request timeout consistent with iOS, do not mess with ios indica…
cristianocca Dec 12, 2019
6e50a4e
added null check to path before creating a File
ihavenoface5 Dec 17, 2019
b8e0dff
Update RNFetchBlobFS.java
ihavenoface5 Dec 17, 2019
2d66cbf
Update RNFetchBlobFS.java
ihavenoface5 Dec 17, 2019
d35f806
Merge pull request #507 from joltup/exists-path-null-check
Traviskn Dec 19, 2019
ca2f93d
Merge pull request #504 from Bhavik-P/checkKey
Traviskn Dec 19, 2019
a2c1ba5
Merge pull request #480 from set0gut1/master
Traviskn Dec 19, 2019
577556d
Merge pull request #479 from sadafk831/master
Traviskn Dec 19, 2019
3aefc4b
Merge branch 'master' into wifiOnly
Traviskn Dec 19, 2019
84d5312
Merge pull request #497 from cristianoccazinsp/wifiOnly
Traviskn Dec 19, 2019
e2eef2c
Merge pull request #472 from xamoulin/fix/deprecated-sslSocketFactory
Traviskn Dec 19, 2019
7df77f4
Merge pull request #465 from jsamr/fix-ts
Traviskn Dec 19, 2019
3ea8218
0.12.0
Dec 19, 2019
c6b3727
Update RNFetchBlobReq.java
ihavenoface5 Feb 3, 2020
a10c81d
Merge pull request #530 from joltup/filestorage-class-cast-exception-1
Traviskn Feb 3, 2020
3f75d5e
Update RNFetchBlobReq.java
ihavenoface5 Feb 3, 2020
6923bbb
Merge pull request #531 from joltup/ihavenoface5-patch-1
ihavenoface5 Feb 3, 2020
af52cc7
Update RNFetchBlobReq.java
pex7 Mar 12, 2020
d06e2e9
fix io exception in RNFetchBlobReq
Mar 12, 2020
1933faf
Merge pull request #560 from pex7/master
ihavenoface5 Mar 12, 2020
206f86e
Merge commit '3ea8218fbfe9aa4986ced4c722e4b9265fa96657'
nluzzato May 26, 2020
2911626
Fixed an issue with creating a file from base64 data
nluzzato May 26, 2020
39e4a45
Fix #26
AlAskalany Jul 15, 2020
7a576f0
Update RNFetchBlobReq.java
AlAskalany Jul 15, 2020
4ff2d8a
check if buffer data and content exists before trying get data from s…
Aug 3, 2020
56f6069
Added support for Android API 29
Aug 7, 2020
e221b0a
Added support for Android API 29
Aug 7, 2020
dccab7e
Added support for Android API 29
Aug 7, 2020
9110ef2
Merge pull request #637 from maxiru/fix/crashGetString
ihavenoface5 Aug 11, 2020
e4a545a
Remove IOS7 polyfill for containsString
Sep 14, 2020
7c0ff46
use lodash/reduce replace lodash import
someok Sep 22, 2020
029cf17
Fix actionViewIntent for Android <= 6
Oct 16, 2020
ae41bff
fix: 183 requiring cycles
alexnaiman Oct 22, 2020
dcbde6f
Update README.md
Traviskn Nov 19, 2020
4800aba
Solve network requests not completing in Release [iOS]
Apr 5, 2021
40e3612
Merge branch 'joltup:master' into master
chaits98 Jul 22, 2021
f563d50
fix addAndroidDownloads for paths containing %
juliar Sep 1, 2021
bb6cb92
As jcenter is being shut down, we should use mavenCentral instead.
likesebiii Sep 16, 2021
8b874f9
fixes #64
Sep 29, 2021
18d882e
fix: callback invoke
Nov 2, 2021
eff92b1
Added support to get okhttp library version from rootProject
chaits98 Feb 3, 2022
4abb972
Merge pull request #748 from likesebiii/master
rpenfold Feb 23, 2022
13bc69b
Merge pull request #755 from ziphr/ONRECEIVE-FATAL-ERROR
rpenfold Feb 23, 2022
3f60084
Merge pull request #672 from someok/master
rpenfold Feb 23, 2022
71fcebb
Merge pull request #745 from juliar/android-file-path-encoding-fix
rpenfold Feb 23, 2022
6089a39
Merge pull request #626 from AlAskalany/patch-1
rpenfold Feb 23, 2022
7ebb9a4
Removed "unmaintained" banner
rpenfold Feb 23, 2022
864d975
Merge pull request #665 from yellowtree/master
rpenfold Feb 23, 2022
cc54ea9
Merge pull request #688 from alexnaiman/fix_183_requiring_cycles
rpenfold Feb 23, 2022
988aea9
rev v13 beta version
rpenfold Feb 23, 2022
92ce51a
Merge pull request #723 from teo029/issue-722
rpenfold Feb 23, 2022
4a2f8c4
version fix for consistency
Apr 4, 2022
28f4a54
Merge pull request #685 from Chris-Guy/master
rpenfold Apr 4, 2022
dfc6806
Merge pull request #600 from nadav2051/bugfix/ios-fix-create-file-base64
rpenfold Apr 4, 2022
8876c3c
Merge pull request #646 from chaits98/master
rpenfold Apr 4, 2022
9d74c78
npmignore
rpenfold Jun 7, 2022
0ba3194
Merge branch 'master' of https://github.com/joltup/rn-fetch-blob
rpenfold Jun 7, 2022
a0b26a2
0.13.0-beta.1
rpenfold Jun 7, 2022
fead8a2
remove config for 0.69.0, update readme
RnbWd Jun 28, 2022
cf9e884
Merge pull request #796 from RnbWd/master
rpenfold Jul 25, 2022
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
5 changes: 0 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ local.properties
#
node_modules/
npm-debug.log
yarn.lock

# BUCK
buck-out/
Expand Down
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONTRIBUTORS.md
CONTRIBUTING.md
CODE_OF_CONDUCT.md

.github/
components/
img/
scripts/
8 changes: 1 addition & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
For developers who interested in making contribution to this project, please see [https://github.com/wkh237/react-native-fetch-blob-dev](https://github.com/wkh237/react-native-fetch-blob-dev) for more information.

Please read the following rules before opening a PR :

1. If the PR is offering a feature please make the PR to our "Feature Branch" 0.11.0
2. Bug fix request to "Bug Fix Branch" 0.10.6
3. Correct README.md can directly to master
For developers who interested in making contribution to this project, please see [https://github.com/joltup/rn-fetch-blob-dev](https://github.com/joltup/rn-fetch-blob-dev) for more information.
743 changes: 425 additions & 318 deletions README.md

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion android.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,25 @@ function addCompleteDownload(config) {
return Promise.reject('RNFetchBlob.android.addCompleteDownload only supports Android.')
}

function getSDCardDir() {
if(Platform.OS === 'android')
return RNFetchBlob.getSDCardDir()
else
return Promise.reject('RNFetchBlob.android.getSDCardDir only supports Android.')
}

function getSDCardApplicationDir() {
if(Platform.OS === 'android')
return RNFetchBlob.getSDCardApplicationDir()
else
return Promise.reject('RNFetchBlob.android.getSDCardApplicationDir only supports Android.')
}


export default {
actionViewIntent,
getContentIntent,
addCompleteDownload
addCompleteDownload,
getSDCardDir,
getSDCardApplicationDir,
}
28 changes: 28 additions & 0 deletions android/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android</name>
<comment>Project android created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1634215444278</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
13 changes: 13 additions & 0 deletions android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
26 changes: 17 additions & 9 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
apply plugin: 'com.android.library'

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

repositories {
mavenCentral()
google()
}

buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:4.0.1'
}
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion safeExtGet('compileSdkVersion', 30)
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 30)
versionCode 1
versionName "1.0"
}
Expand All @@ -33,7 +39,9 @@ android {
}

dependencies {
compile 'com.facebook.react:react-native:+'
//compile 'com.squareup.okhttp3:okhttp:+'
//{RNFetchBlob_PRE_0.28_DEPDENDENCY}
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
implementation "com.squareup.okhttp3:okhttp:${safeExtGet('okhttp', '+')}"
implementation "com.squareup.okhttp3:logging-interceptor:${safeExtGet('okhttp', '+')}"
implementation "com.squareup.okhttp3:okhttp-urlconnection:${safeExtGet('okhttp', '+')}"
// {RNFetchBlob_PRE_0.28_DEPDENDENCY}
}
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
android.enableJetifier=true
android.useAndroidX=true
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Aug 12 07:48:35 CEST 2017
#Fri Aug 07 22:58:34 IST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
32 changes: 30 additions & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.RNFetchBlob">

<application
android:label="@string/app_name">
<!-- Required to access Google Play Licensing -->
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />

<!-- Required to download files from Google Play -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- Required to keep CPU alive while downloading files
(NOT to keep screen awake) -->
<uses-permission android:name="android.permission.WAKE_LOCK" />

<!-- Required to poll the state of the network connection
and respond to changes -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- Required to check whether Wi-Fi is enabled -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<!-- Required to read and write the expansion files on shared storage -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application android:label="@string/app_name">

<provider
android:name="com.RNFetchBlob.Utils.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
</application>

</manifest>
54 changes: 42 additions & 12 deletions android/src/main/java/com/RNFetchBlob/RNFetchBlob.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import android.app.Activity;
import android.app.DownloadManager;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import androidx.core.content.FileProvider;
import android.util.SparseArray;

import com.facebook.react.bridge.ActivityEventListener;
Expand All @@ -21,10 +24,11 @@
import com.facebook.react.modules.network.ForwardingCookieHandler;
import com.facebook.react.modules.network.CookieJarContainer;
import com.facebook.react.modules.network.OkHttpClientProvider;
import okhttp3.OkHttpClient;

import okhttp3.JavaNetCookieJar;
import okhttp3.OkHttpClient;

import java.util.HashMap;
import java.io.File;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
Expand Down Expand Up @@ -100,16 +104,31 @@ public void run() {
RNFetchBlobFS.createFileASCII(path, dataArray, promise);
}
});

}

@ReactMethod
public void actionViewIntent(String path, String mime, final Promise promise) {
try {
Intent intent= new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse("file://" + path), mime);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.getReactApplicationContext().startActivity(intent);
Uri uriForFile = FileProvider.getUriForFile(this.getReactApplicationContext(),
this.getReactApplicationContext().getPackageName() + ".provider", new File(path));

// Create the intent with data and type
Intent intent = new Intent(Intent.ACTION_VIEW)
.setDataAndType(uriForFile, mime);

// Set flag to give temporary permission to external app to use FileProvider
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
// All the activity to be opened outside of an activity
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

// Validate that the device can open the file
PackageManager pm = getCurrentActivity().getPackageManager();
if (intent.resolveActivity(pm) != null) {
this.getReactApplicationContext().startActivity(intent);
} else {
promise.reject("EUNSPECIFIED", "Cannot open the URL.");
}

ActionViewVisible = true;

final LifecycleEventListener listener = new LifecycleEventListener() {
Expand Down Expand Up @@ -164,7 +183,6 @@ public void run() {
RNFetchBlobFS.cp(path, dest, callback);
}
});

}

@ReactMethod
Expand Down Expand Up @@ -225,7 +243,6 @@ public void run() {
RNFetchBlobFS.writeFile(path, encoding, data, append, promise);
}
});

}

@ReactMethod
Expand Down Expand Up @@ -260,7 +277,6 @@ public void run() {
new RNFetchBlobFS(ctx).scanFile(p, m, callback);
}
});

}

@ReactMethod
Expand Down Expand Up @@ -316,7 +332,7 @@ public void df(final Callback callback) {
fsThreadPool.execute(new Runnable() {
@Override
public void run() {
RNFetchBlobFS.df(callback);
RNFetchBlobFS.df(callback, getReactApplicationContext());
}
});
}
Expand All @@ -331,7 +347,7 @@ public void enableUploadProgressReport(String taskId, int interval, int count) {
@ReactMethod
public void fetchBlob(ReadableMap options, String taskId, String method, String url, ReadableMap headers, String body, final Callback callback) {
new RNFetchBlobReq(options, taskId, method, url, headers, body, null, mClient, callback).run();
}
}

@ReactMethod
public void fetchBlobForm(ReadableMap options, String taskId, String method, String url, ReadableMap headers, ReadableArray body, final Callback callback) {
Expand All @@ -353,6 +369,11 @@ public void getContentIntent(String mime, Promise promise) {
@ReactMethod
public void addCompleteDownload (ReadableMap config, Promise promise) {
DownloadManager dm = (DownloadManager) RCTContext.getSystemService(RCTContext.DOWNLOAD_SERVICE);
if (config == null || !config.hasKey("path"))
{
promise.reject("EINVAL", "RNFetchblob.addCompleteDownload config or path missing.");
return;
}
String path = RNFetchBlobFS.normalizePath(config.getString("path"));
if(path == null) {
promise.reject("EINVAL", "RNFetchblob.addCompleteDownload can not resolve URI:" + config.getString("path"));
Expand All @@ -377,4 +398,13 @@ public void addCompleteDownload (ReadableMap config, Promise promise) {

}

@ReactMethod
public void getSDCardDir(Promise promise) {
RNFetchBlobFS.getSDCardDir(this.getReactApplicationContext(), promise);
}

@ReactMethod
public void getSDCardApplicationDir(Promise promise) {
RNFetchBlobFS.getSDCardApplicationDir(this.getReactApplicationContext(), promise);
}
}
Loading