Reputation: 1674
In expo-image-picker the type of assetId is of type string | null | undefined and it says
This might be null when the ID is unavailable or the user gave limited permission to access the media library. On Android, the ID is unavailable when the user selects a photo by directly browsing file system.
What does it mean in practice? How much can I be sure that this ID would be present since in expo-image-picker in pickImage handler there is a comment that no permissions are necessary
const pickImage = async () => {
// No permissions request is necessary for launching the image library
let result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.All,
allowsEditing: true,
aspect: [4, 3],
quality: 1,
});
console.log(result);
if (!result.canceled) {
setImage(result.assets[0].uri);
}
};
is user able to pick the image directly from the file system? How much can I be sure that this id will be present? Or should I derive it from the uri?
Thanks
Upvotes: 1
Views: 370