Closed EYALIN closed 7 months ago
@breautek the errors here are not related to my commits (IOS for example? ) can someone merge it?
@EYALIN DO you have any experience with the corodva-plugin-saf-mediastore?
I need to write media files into the gallery(external storage) on Android 13 but so far I have no success with the saf-mediastore plugin. Any alternatives?
I would be glad for any help ,thank you!
@MauriceFrank i'm using the photo library plugin, you can take my fork: https://github.com/EYALIN/cordova-plugin-photo-library
@EYALIN the fix works great thank you, can someone merge it ?
@EYALIN can you please correct the indentation.
Also, remove the private field permissions
which is never used (lines 102-116).
And why not completly removing this whole methods hasWritePermission
and getWritePermission
? since cordova-plugin-file v8 requires cordova-android 12+ with support for Android 24+, while WRITE_EXTERNAL_STORAGE
is not supported since 19.
And why not completly removing this whole methods
hasWritePermission
andgetWritePermission
? since cordova-plugin-file v8 requires cordova-android 12+ with support for Android 24+, whileWRITE_EXTERNAL_STORAGE
is not supported since 19.
WRITE_EXTERNAL_STORAGE
is still used between API 24-28. It's not used with Scoped Storage mechanism.
Between API-24-28, the permission is not required for your app's external data directory, but is required to write to external shared directories (e.g. the Downloads
directly).
But there are other significant issues with using the external filesystem on API 29+ that makes using a filesystem oriented API not feasible and I feel like we should just simply drop support for it in favour of media store plugin that interfaces with the native MediaStore instead. If we do go that route, then we can drop the permissions and probably simplify the file plugin significantly.
To me, hasReadPermission
and hasWritePermission
should be left unchanged, because they already return the correct status for *_EXTERNAL_STORAGE
permissions - if considering it strictly.
And, as I work on PR #597, I like the idea that this plugin should concentrate on file operations among the app dirs only, default authorized without any permission ; and that trying to read-write outside should be done using other plugins, to follow the concepts and isolation forced by Google for file-sharing between apps or publicly, relying on SAF, MediaStore, ContentProvider, etc.
For more tech review:
getWritePermission(
is supposed to continue through its callbackContext
param, and permission process, and so doing nothing in the if
you added seems wrong
in Android 13 we don't need to ask for permissions
Platforms affected
Android
Motivation and Context
Closes #606 Closes #577
Description
Testing
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)