Skip to content
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

Save image to user media library when taken from camera during composing #3180

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented Mar 12, 2024

Simple one here. Saves pics taken with the camera to the media library as well when composing a post.

@surfdude29
Copy link
Contributor

Apologies for jumping in (yet again), I'm wondering: does {saveImageToMediaLibrary} automatically take care of camera roll/photo gallery permissions if the user hasn't granted that? Sorry if it's a stupid question

@haileyok
Copy link
Contributor Author

haileyok commented Mar 12, 2024

It actually should (for me it worked fine on Android) but there's no harm in checking again (might not work on iOS).

Besides, I think it make more sense to access MediaLibrary directly here and prevent any dupes, we can just move all the logic into here to handle it. So yup, we'll handle the perms calls here.

@surfdude29
Copy link
Contributor

surfdude29 commented Mar 12, 2024

Sounds sensible to me (but you obviously know much more about these things than I do :) The thought occurred as I know Camera and Photos are separate permissions on iOS (I don't have any experience with Android) and when I just tested on a fresh install of the current app, taking a photo prompted for Camera permission but not Photos (I realise it's not saving Camera images atm of course).

And sorry for the annoying questions btw, thank you for being so friendly and patient in answering and explaining to someone who's very much a newbie 🙏

@haileyok
Copy link
Contributor Author

haileyok commented Mar 12, 2024

Feel free! They actually are not the same permission! Simulator didn't error besides telling me there was no camera so first check looked good, but ended up not working on the device build.

We should actually probably move the logic for checking perms right into these helper functions rather than having to do do the perms check logic each time we call openCamera() or openImagePicker() and prevent forgetting to do it. Something for another time though 😅

@surfdude29
Copy link
Contributor

We should actually probably move the logic for checking perms right into these helper functions rather than having to do do the perms check logic each time we call openCamera() or openImagePicker() and prevent forgetting to do it. Something for another time though 😅

Yeah I know you all have a long enough TODO list as is 😅

@haileyok haileyok merged commit 80cc1f1 into main Mar 12, 2024
4 checks passed
@haileyok haileyok deleted the hailey/save-image-camera branch March 12, 2024 16:46
estrattonbailey added a commit that referenced this pull request Mar 12, 2024
…on-2

* origin/main:
  Small fixes (#3184)
  Combine actions, convert to new menu (#3174)
  Convert profile edit avatar/banner dropdown menus to new menu (#3177)
  Save image to user media library when taken from camera during composing (#3180)
  Dedupe navigation events (push, navigate, pop, etc) (#3179)
  Unwrap Menu.Trigger on web (#3182)
  move imports to top
  move button inline if viewport is small (vertically)
  Update po files
  Fix onboarding `FeedCard` text overflow (#3176)
  Fix `lineHeight` problems on native with new `Text` (#3175)
  only include `localhost:19006` as intent filter on android (#3167)
  await `share` before closing menu (#3173)
  Fix button widths in the Settings on web (#3165)
  Fix font styles on web (#3162)
  Fix `aria-label` on the Share button (#3159)
  Fix RSS URLs treated as internal (#3156)
  Poll Statsig for config changes (#3158)
  Fix missing check for invite code (#3157)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants