Ver código fonte

Remove statement that uses deprecated OkHttp API

Ben Hsieh 8 anos atrás
pai
commit
80cc711a5c

+ 1
- 1
src/android/build.gradle Ver arquivo

@@ -34,5 +34,5 @@ android {
34 34
 
35 35
 dependencies {
36 36
     compile 'com.facebook.react:react-native:+'
37
-    compile 'com.squareup.okhttp3:okhttp:3.4.1'
37
+    //{RNFetchBlob_PRE_0.28_DEPDENDENCY}
38 38
 }

+ 1
- 1
src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java Ver arquivo

@@ -451,7 +451,7 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
451 451
                 break;
452 452
         }
453 453
         removeTaskInfo();
454
-        resp.close();
454
+//        resp.close();
455 455
     }
456 456
 
457 457
     /**

+ 9
- 9
src/scripts/prelink.js Ver arquivo

@@ -35,15 +35,15 @@ if(VERSION >= 0.29) {
35 35
 
36 36
 }
37 37
 
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
+}
47 47
 
48 48
 // set file access permission for Android < 6.0
49 49
 fs.readFile(MANIFEST_PATH, function(err, data) {