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

[ios][camera] Fix path where camera saves picture on simulator #20872

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

pettomartino
Copy link
Contributor

@pettomartino pettomartino commented Jan 18, 2023

Why

When taking photo using takePictureAsync there is a specific implementation for the simulator.
However when building the directory where the file will be save, there is a small bug with the concatenation. The concatenation with the cacheDirectory is missing the slash (/) so it creates a folder called CachesCamera rather than Caches/Camera as the device implementation does.
This creates an issue because FileSystem can't access this folder thus files can't be deleted. This issue creates in inconsistency between development environment and real device.

How

I added a slash / to the string. Assuming this implementation works only on simulator which works only on macOS, the file system will always use / as directory separator so I believe we can just add this missing /

Test Plan

Use expo-camera and call the method takePictureAsync. Check the uri of the file generated.

Checklist

@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Jan 18, 2023
Copy link
Contributor

@lukmccall lukmccall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🔥
Thanks for your contribution 🏅

@lukmccall lukmccall merged commit 8bc4cb9 into expo:main Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants