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 legacy camera getAvailablePictureSizes #27642
[ios][camera] Fix legacy camera getAvailablePictureSizes #27642
Conversation
The Pull Request introduced fingerprint changes against the base commit: 4844826 Fingerprint diff[
{
"type": "dir",
"filePath": "../../packages/expo-camera/ios",
"reasons": [
"expoAutolinkingIos"
],
"hash": "9f3f091e46c30e63842b035fb47205315f903062"
}
] Generated by PR labeler 🤖 |
@@ -201,7 +201,9 @@ public final class CameraViewModule: Module { | |||
|
|||
AsyncFunction("getAvailablePictureSizes") { (_: String?, _: Int) in | |||
// Argument types must be compatible with Android which receives the ratio and view tag. | |||
return pictureSizesDict.keys | |||
return pictureSizesDict.map { k, _ in |
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.
That's why we need more tests. It seems pretty easy to detect.
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.
Definitely. Not sure how that got through for so long
Why
Fixes an issue reported by @kbrandwijk, where the
pictureSize
was not being setHow
The problem was
getAvailablePictureSizes
was returningpictureSizesDict.keys
which does not return an array ofString
but an array ofKey
structs. This would not get correctly parsed so would result in an empty array being sent back to JS.Test Plan
Bare-expo. The array is now correctly sent back and using the
pictureSize
prop works correctly.