-
-
Notifications
You must be signed in to change notification settings - Fork 33
No Read Permission on PersistedUris #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the issue, what kind of error are you having? |
If I understood correctly, you don't need the If you have the |
how can I read all the data from below given specific folder URI ? Ex. content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses |
Unfortunately this usecase is not currently supported, but I added this as a new feature request in #11, I'm planning to implement it on this weekend. Feel free to implement it by yourself if you want! Thanks for the issue. |
Thank you so much for your hard-work, But I don't know much about Java so I will use this package once you add support for read data. Additional note Once again Thank you so much for this amazing package :) |
Hey @ankitparmar007! g'afternoon Your usecase is to get large data sets? Like a folder with 1000+ files? |
Hey @LaksCastro Glad to know that you are putting so much effort on this package :) Thank you so much for that ! Based on this URI content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses I am trying to read WhatsApp Statuses folder from this path => Android/media/com.whatsapp/WhatsApp/Media/.Statuses So there is a possibility if user have business account or large user base in WhatsApp account then, Statuses may be available up-to 500 or more including images and videos. As I can see that in 11 you have mentioned that you are facing issue for reading files which folder has so many files in it. In my opinion you can limit the number of files reads up-to 1000 if you have no any other solution available currently. Addition Note If you need any other Help, For testing the package or live help on social media where we can easily communicate, I would really like to connect with you on you preferred social media account :) |
Hey! Thanks for sharing your usecases. Okay, I think I got your needs, this is about WhatsApp statuses and you need the Also, I think you'll need an way to export these files to another location, so maybe I also need to include some
Btw, my Discord is always open |
Ya I think You need to copy or cached all the files from URI specified folder to application cached folder for easy read I guess, |
…mentsContract.getDocumentThumbnail` API
Hardcoded WhatsApp Status Media URI to use as
Usage: const kWhatsAppStatusUri = '...';
/// Prompt user with a folder picker (Available for Android 5.0+)
await openDocumentTree(initialUri: Uri.parse(kWhatsAppStatusUri)); |
@lakscastro Good to see you working on package again :) Syntax to get application specific temp directory using path provider package Maybe You can store all the data given by openDocumentTree() method and store it in application specific cache folder(path given by tempPath) so app owner can easily clean up temp folder for storing more fresh data or can be deleted easily when there is no need of it. Thank you so much again :) |
yeah, of course, you can store the path wherever you want. You can also use a package like I mean that this specific path of the WhatsApp status is not available to get it from anywhere, so we need to hardcode it to use as But be aware that this is the solution that I'm trying, you can send me any solutions that you think that will fill better our usecase! |
@lakscastro Also end user won't pass any path to initialDir parameter, Only app developer can assign path to initialDir to open a specific folder, so in my opinion you don't need to hard-code WhatsApp Statuses Path. If app Developer don't want to assign anything to initialDir then root directory will be open otherwise assigned path will be open using openDocumentTree(). If you didn't get it, no problem just let me know what you didn't understand, I will share video example on discord :) |
where do you'll get the |
@lakscastro print(selectedUriDir); currently we can get WhatsApp Statues folder path by first opening root directory using openDocumentTree(); method and later user has to travel to this path later openDocumentTree() method return the path for user selected folder and as you mentioned in above comment we can store same path in But my point is can we read all the files from this path below is an example for how we can read files @override
void initState() {
super.initState();
var data = await openDocumentTree(initialUri: Uri.parse("content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia/document/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses%2FMedia"));
} later we can show data in APP UI ??? also when calling openDocumentTree() method for the first time we can set initialDir path like this consider a point in this case we know the path already so we can directly assign path to initialDir parameter so user doesn't have to travel for the first time also and user can give the permission to read all the data from specified path :) Hope you get my point :) |
currently, |
Ohh that's a bad news :( |
No, I mean that we just need to use SAF (Android 5.0+) Most Starting from new Android APIs (API Level 30+) |
Bro Lets discuss on discord for effective and fast communication :) |
Oh, of course |
@lakscastro hey bro image uri would be like this Decoded image uri looks like this or for video uri looks like this so can you try like this once we select the directory using openDocumentTree() then this method should return LIST OF URIs for all the files located in selected folder |
@ankitparmar007 @lakscastro Hello folks. Does this package support the reading files from the Android folder using SAF DocumentTree yet? :) |
@jvoltci not fully ! This package needs more improvements |
Hey @ankitparmar007 ! Let's evolve this package because I researched and could not find any relevant package for this problem. Let's catch up, ping me on @jvoltci tweeter if are up! |
Hey @jvoltci Sorry to say but, I am not a twitter user ! you can connect with me on discord using this username ankit007#2133 |
Closing this issue as resolved since all mentioned use-cases are now available in Please, you can always re-open this one or open a new issue. Any other bug-reports, questions or feature requests are always welcome! Thanks for taking time to contribute to this package. |
final selectedUriDir = await openDocumentTree();
selectedUriDir = content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses
final listOfPersistedUris = await persistedUriPermissions();
listOfPersistedUris [UriPermission(isReadPermission: false, isWritePermission: true, persistedTime: 1638318739830, uri: content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2F.Statuses)]
AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
**
**
The text was updated successfully, but these errors were encountered: