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

Commit 80cc711

Browse files
committed
Remove statement that uses deprecated OkHttp API
1 parent 72324bd commit 80cc711

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ android {
3434

3535
dependencies {
3636
compile 'com.facebook.react:react-native:+'
37-
compile 'com.squareup.okhttp3:okhttp:3.4.1'
37+
//{RNFetchBlob_PRE_0.28_DEPDENDENCY}
3838
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ private void done(Response resp) {
451451
break;
452452
}
453453
removeTaskInfo();
454-
resp.close();
454+
// resp.close();
455455
}
456456

457457
/**

src/scripts/prelink.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ if(VERSION >= 0.29) {
3535

3636
}
3737

38-
// if(VERSION <= 0.28) {
39-
// console.log('You project version is '+ VERSION + 'which does not meet requirement of react-native-fetch-blob 7.0+, please upgrade your application template to react-native 0.27+, otherwise Android application will not working.')
40-
// add OkHttp3 dependency fo 0.28- project
41-
// var main = fs.readFileSync(PACKAGE_GRADLE);
42-
// console.log('adding OkHttp3 dependency to pre 0.28 project .. ')
43-
// main = String(main).replace('//{RNFetchBlob_PRE_0.28_DEPDENDENCY}', "compile 'com.squareup.okhttp3:okhttp:3.4.1'");
44-
// fs.writeFileSync(PACKAGE_GRADLE, main);
45-
// console.log('adding OkHttp3 dependency to pre 0.28 project .. ok')
46-
// }
38+
if(VERSION < 0.28) {
39+
console.log('You project version is '+ VERSION + 'which does not meet requirement of react-native-fetch-blob 7.0+, please upgrade your application template to react-native 0.27+, otherwise Android application will not working.')
40+
add OkHttp3 dependency fo 0.28- project
41+
var main = fs.readFileSync(PACKAGE_GRADLE);
42+
console.log('adding OkHttp3 dependency to pre 0.28 project .. ')
43+
main = String(main).replace('//{RNFetchBlob_PRE_0.28_DEPDENDENCY}', "compile 'com.squareup.okhttp3:okhttp:3.4.1'");
44+
fs.writeFileSync(PACKAGE_GRADLE, main);
45+
console.log('adding OkHttp3 dependency to pre 0.28 project .. ok')
46+
}
4747

4848
// set file access permission for Android < 6.0
4949
fs.readFile(MANIFEST_PATH, function(err, data) {

0 commit comments

Comments
 (0)