cordova-plugin-advanced-http
cordova-plugin-advanced-http copied to clipboard
[Feature] split up HTTP Communication & file transfer
Repro:
- add cordova-plugin-advanced-http to any Cordova project
- Build Android apk
- Inspect platforms/android/app/src/main/AndroidManifest.xml
Observe: a line with WRITE_EXTERNAL_STORAGE permission is present
Expected: no WRITE_EXTERNAL_STORAGE
System info
- affected HTTP plugin version: 2.1.1
- affected platform(s) and version(s): Android
- cordova version: 8.0
- cordova platform version(s): android 8.0.0
Why would you need to write to SD card when making HTTP requests? If the app needs to download a file from Internet to SD card WRITE_EXTERNAL_STORAGE permission should be added by the app and not by plugin.
I think this is because dependant cordova-plugin-file requires that permission: https://github.com/apache/cordova-plugin-file/blob/master/plugin.xml#L137
Hi chuchuva, you're right this behaviour comes from the dependant file plugin. This plugin does not reference this kind of permissions (see https://github.com/silkimen/cordova-plugin-advanced-http/blob/master/plugin.xml#L63). But I don't think this is a bug, because actually we need to have this permission when dealing with files e.g. downloading or uploading files from storage.
See also https://github.com/apache/cordova-plugin-file/issues/243
@silkimen This is a bug / unexpected behaviour. I need to integrate native http requests into my code, not uploading/downloading any files. It doesn't make sense to request this permissions from the users as @chuchuva mentioned before.
Edit: also, Apple might reject apps requesting this permission, when theres no feature using it.
See also apache/cordova-plugin-file#243
It seems that downgrading cordova-plugin-file to version 3.0.0 gets rid of the problematic permission. Would it be possible to have a mean to specify the version of cordova-plugin-file that we need like you did with OKHTTP one ? Thanks.
Edit : never mind, downgrading to version 3.0.0 of cordova-plugin-file does not seem to work...
Hi guys, this might be an unexpected behavior to you, but I can't just remove the dependency, because there is some code integrated in this plugin depending on the cordova file plugin. Removing this code means removing features. Therefore I've marked this as a (breaking) feature request. Maybe we can extract this features into another plugin in a future major release.
see also related issue cordova-plugin-file#243