cordova-plugin-advanced-http icon indicating copy to clipboard operation
cordova-plugin-advanced-http copied to clipboard

[Bug] [Android] "Error -6 No network connection available" when connected to a wifi without internet

Open ErwanLGZ29 opened this issue 2 years ago • 3 comments

I am using an Redmi 10c android 12 smartphone that does not have a 4g connection. It is connected to a private wifi that doesn't have internet either and I try to make an http request on a route from a local server, the request does not work and returns an error -6, "No network connection available". The smartphone is connected to the server's wifi and the route is available.

I created a fork of this plugin by commenting the verification on 'isNetWorkAvailable' and I could communicate in http to my local server in wifi without any problem : https://github.com/ErwanLGZ29/cordova-plugin-advanced-http/blob/master/src/android/com/silkimen/cordovahttp/CordovaHttpPlugin.java

ErwanLGZ29 avatar Nov 22 '22 16:11 ErwanLGZ29

Thanks, same problem here, i will test your fork !

davidanquetin avatar Nov 25 '22 15:11 davidanquetin

Same issue here when trying to communicate with smart home devices which have not internet...

digaus avatar Nov 29 '22 00:11 digaus

Would you please propose an option for disabling this feature and create a PR? e.g.

  • programmatically by API,
  • or descriptively by setting a cordova plugin preference (see "AndroidBlacklistSecureSocketProtocols" as an example here: https://github.com/silkimen/cordova-plugin-advanced-http/blob/master/plugin.xml#LL11C21-L11C58)

I would actually prefer second option but open for comments and discussion.

silkimen avatar May 24 '23 00:05 silkimen