How to use the expo-media-library.createAssetAsync function in expo-media-library

To help you get started, we’ve selected a few expo-media-library examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / home / utils / ImageSelectionUtils.ts View on Github external
export async function takePhotoAsync(): Promise {
  if (!(await ensurePermissionsAsync())) return null;

  const media = await ImagePicker.launchCameraAsync(mediaOptions);
  if (!media.cancelled) {
    const asset = await MediaLibrary.createAssetAsync(media.uri);
    return await moveToPhotoCacheAsync(asset.uri);
  }
  return null;
}
github expo / expo / apps / native-component-list / src / screens / Camera / GalleryScreen.tsx View on Github external
const promises = photos.map(photoUri => {
        return MediaLibrary.createAssetAsync(photoUri);
      });
github expo / expo / apps / native-component-list / src / screens / Camera / GalleryScreen.web.tsx View on Github external
const promises = photos.map(photoUri => {
        return MediaLibrary.createAssetAsync(photoUri);
      });