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
fix(android)!: avoid showing permissions prompt & migrate write location #871
fix(android)!: avoid showing permissions prompt & migrate write location #871
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Except for the suggestions, it looks great! There is any change that we should be aware since we are changing how the library handles files on android?
Co-authored-by: Mateus Andrade <mateus.andrade47@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you update your base branch with the master? Except from that LGTM!
Thanks @MateusAndrade - I've tested all the other scenarios in the sample app and noticed the "Share to IG Story" one doesn't appear to be working. I suspect it's something to do with the FileProvider, but looking into it |
There is anything that I can help you with? |
I think I've narrowed it down to pre-existing behaviour. I checked out 1a80835 from before my changes and it behaves the same: I notice in the logcat output an error with exif parsing which may indicate the problem:
It is passing the png mimetype with the intent but maybe this error indicates instagram is performing some default behaviour or doesn't recognize that mimetype In any case, doesn't seem related to my changes To your earlier question tho: I think the biggest thing to callout about the deprecated method change ( |
Actually this may be breaking if they had defined the FileProvider paths, since it requires a different child attribute:
I'm unable to find a case in the example app where this was required, though. |
@sterlingwes we can go on merging this? |
I'll defer to you on this - I think this should be marked as a breaking change & have commensurate docs on how to migrate any usage of |
I can update if you feel that's appropriate, otherwise feel free to merge I'm satisfied with my manual testing @MateusAndrade |
This would be amazing! I can merge this with a |
--- | ||
id: migrate-v3-to-v4 | ||
title: Migrating to v4 | ||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok good to go on my end if you are @MateusAndrade 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!!!!! Thanks a lot, @sterlingwes! 🚀 🚀 🚀 🚀 🚀 🚀
--- | ||
id: migrate-v3-to-v4 | ||
title: Migrating to v4 | ||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!!!!! Thanks a lot, @sterlingwes! 🚀 🚀 🚀 🚀 🚀 🚀
🎉 This PR is included in version 3.8.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
For anybody looking after |
Hi all, is there a way to force v4 to keep saving files into Download directory? |
Did you try adding this config to your |
Hi, Is there a way to save the file in the public Download directory so the user could open it using any file browser? |
@marcorm @imdaniele can you confirm which APIs you're using to share / save the files? Are they base64'd? Which external app(s) specifically are trying to access the file and unable to do so? Specific reproduction steps would help in ensuring this workflow is in the sample app and can be tested |
Hi @sterlingwes ,
without a FileProvider. The shared file can't be listed as a media file, so it's not visible to the user. In the previous version the
was accessible by the user (in the "Download" directory), but with the current release files inside
are only visible to the application.
|
Thanks @imdaniele for the extra info! It sounds like you might have been relying on an internal implementation detail of this lib? Where the file is saved in order to facilitate the share sheet is a byproduct of the main API use case, which is to share a file with another application. Or at least that's how I understand this lib's set of APIs. I'll defer to the core maintainers here but I feel like this should be opened as a separate issue proposing an API surface change. Perhaps |
Overview
We were looking to this library for a way to share a base64-encoded PDF and noticed a couple things:
getExternalStorageDirectory
is deprecatedThis maybe solves #843
Test Plan
I've currently only tested my happy path - but if this seems like an OK approach, I'll test all the other methods available in the sample app.
BREAKING CHANGE: write location & permission prompt behaviour changed