Skip to content

Syncing with main branch, support for 0.60 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jul 30, 2019
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
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# New Releases
In order to publish new releases from this fork, we have renamed this project to
`rn-fetch-blob` and published to `https://www.npmjs.com/package/rn-fetch-blob`.

**Note**: If upgrading from the original fork change all references in your project from `react-native-fetch-blob` to `rn-fetch-blob`. This includes `*.xcodeproj/project.pbxproj` and `android/**/*.gradle` depending on the platform used, failing to do so may cause build errors.

# rn-fetch-blob
[![release](https://img.shields.io/github/release/joltup/rn-fetch-blob.svg?style=flat-square)](https://github.com/joltup/rn-fetch-blob/releases) [![npm](https://img.shields.io/npm/v/rn-fetch-blob.svg?style=flat-square)](https://www.npmjs.com/package/rn-fetch-blob) ![](https://img.shields.io/badge/PR-Welcome-brightgreen.svg?style=flat-square) [![](https://img.shields.io/badge/Wiki-Public-brightgreen.svg?style=flat-square)](https://github.com/joltup/rn-fetch-blob/wiki) [![npm](https://img.shields.io/npm/l/rn-fetch-blob.svg?maxAge=2592000&style=flat-square)]()


A project committed to making file access and data transfer easier and more efficient for React Native developers.
> For Firebase Storage solution, please upgrade to the latest version for the best compatibility.

# Version Compatibility Warning

rn-fetch-blob version 0.10.16 is only compatible with react native 0.60 and up. It should have been a major version bump, we apologize for the mistake. If you are not yet upgraded to react native 0.60 or above, you should remain on rn-fetch-blob version 0.10.15

## Features
- Transfer data directly from/to storage without BASE64 bridging
Expand Down
10 changes: 6 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ def safeExtGet(prop, fallback) {

repositories {
mavenCentral()
jcenter()
google()
}

buildscript {
Expand All @@ -14,16 +16,16 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.2.1'
}
}

android {
compileSdkVersion safeExtGet('compileSdkVersion', 26)
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 26)
targetSdkVersion safeExtGet('targetSdkVersion', 28)
versionCode 1
versionName "1.0"
}
Expand Down
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/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<application android:label="@string/app_name">

<provider
android:name="android.support.v4.content.FileProvider"
android:name="com.RNFetchBlob.Utils.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
Expand All @@ -34,4 +34,4 @@
</provider>
</application>

</manifest>
</manifest>
3 changes: 1 addition & 2 deletions android/src/main/java/com/RNFetchBlob/RNFetchBlob.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.support.v4.content.FileProvider;
import androidx.core.content.FileProvider;
import android.util.SparseArray;

import com.facebook.react.bridge.ActivityEventListener;
Expand All @@ -28,7 +28,6 @@
import okhttp3.JavaNetCookieJar;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/com/RNFetchBlob/RNFetchBlobBody.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.RNFetchBlob;

import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.util.Base64;

import com.facebook.react.bridge.Arguments;
Expand Down
3 changes: 1 addition & 2 deletions android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.util.Base64;

import com.RNFetchBlob.Response.RNFetchBlobDefaultResp;
import com.RNFetchBlob.Response.RNFetchBlobFileResp;
import com.facebook.common.logging.FLog;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.RNFetchBlob.Response;

import android.support.annotation.NonNull;
import android.util.Log;
import androidx.annotation.NonNull;

import com.RNFetchBlob.RNFetchBlobConst;
import com.RNFetchBlob.RNFetchBlobProgressConfig;
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/java/com/RNFetchBlob/Utils/FileProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.RNFetchBlob.Utils;

public class FileProvider extends androidx.core.content.FileProvider {
}
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
DeviceEventEmitter,
NativeAppEventEmitter,
Platform,
AsyncStorage,
AppState,
} from 'react-native'
import type {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rn-fetch-blob",
"version": "0.10.15",
"version": "0.10.16",
"description": "A module provides upload, download, and files access API. Supports file stream read/write for process large files.",
"main": "index.js",
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion polyfill/FileReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.

import RNFetchBlob from '../index.js'
import ProgressEvent from './ProgressEvent.js'
import EventTarget from './EventTarget'
import Blob from './Blob'
Expand Down
6 changes: 3 additions & 3 deletions rn-fetch-blob.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = "rn-fetch-blob"
s.version = "0.10.6"
s.version = "0.10.16"
s.summary = "A project committed to make file acess and data transfer easier, effiecient for React Native developers."
s.requires_arc = true
s.license = 'MIT'
s.homepage = 'n/a'
s.source = { :git => "https://github.com/joltup/rn-fetch-blob", :tag => 'v0.10.10'}
s.source = { :git => "https://github.com/joltup/rn-fetch-blob", :tag => 'v0.10.16'}
s.author = 'Joltup'
s.source_files = 'ios/**/*.{h,m}'
s.platform = :ios, "8.0"
s.dependency 'React/Core'
s.dependency 'React-Core'
end