最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

react native - expo-image-picker is not working in iOS but works fine in Android - Stack Overflow

programmeradmin3浏览0评论

expo-image-picker is working fine in Android but not working in iOS. Here is my code for opening library:

const openImageLibrary = async () => {
    console.log('here');
    const {status} = await ImagePicker.requestMediaLibraryPermissionsAsync();
    console.log({status});
    try {
      const response = await ImagePicker.launchImageLibraryAsync({
        mediaTypes: ['images'],
      });
      console.log({response});
      if (!response.canceled) {
        setPickedImage(response.assets?.[0].uri);
      }
    } catch (error) {
      console.log('error', error);
    }
  };

In my terminal console, i can see these outputs:

here
{"status": "granted"}

Versions, i am using:

"expo": "^52.0.33",
"expo-image-picker": "~16.0.6"

Development:

Real device, Expo GO, Iphone 15 Pro Max
发布评论

评论列表(0)

  1. 暂无评论