diff --git a/patches/expo-image-picker+17.0.10.patch b/patches/expo-image-picker+17.0.10.patch new file mode 100644 index 0000000000..b8867293a4 --- /dev/null +++ b/patches/expo-image-picker+17.0.10.patch @@ -0,0 +1,29 @@ +diff --git a/node_modules/expo-image-picker/ios/MediaHandler.swift b/node_modules/expo-image-picker/ios/MediaHandler.swift +index 6e4fbe1..e334abb 100644 +--- a/node_modules/expo-image-picker/ios/MediaHandler.swift ++++ b/node_modules/expo-image-picker/ios/MediaHandler.swift +@@ -310,10 +310,12 @@ internal struct MediaHandler { + let fileExtension = getFileExtension(from: originalFilename) + let destinationUrl = try generateUrl(withFileExtension: fileExtension) + ++ let resourceOptions = PHAssetResourceRequestOptions() ++ resourceOptions.isNetworkAccessAllowed = true + try await PHAssetResourceManager.default().writeData( + for: resource, + toFile: destinationUrl, +- options: nil ++ options: resourceOptions + ) + + let mimeType = getMimeType(from: destinationUrl.pathExtension) +@@ -389,7 +391,9 @@ internal struct MediaHandler { + + // Stream the resource into our cache directory. This API is asynchronous but doesn't require + // a temporary file like `loadFileRepresentation`. +- try await PHAssetResourceManager.default().writeData(for: resource, toFile: destinationUrl, options: nil) ++ let resourceOptions = PHAssetResourceRequestOptions() ++ resourceOptions.isNetworkAccessAllowed = true ++ try await PHAssetResourceManager.default().writeData(for: resource, toFile: destinationUrl, options: resourceOptions) + + // Build and return the result using the helper. + let mimeType = getMimeType(from: destinationUrl.pathExtension) diff --git a/src/lib/media/picker.shared.ts b/src/lib/media/picker.shared.ts index 270910e851..d7d8dab440 100644 --- a/src/lib/media/picker.shared.ts +++ b/src/lib/media/picker.shared.ts @@ -2,6 +2,7 @@ import { type ImagePickerOptions, launchImageLibraryAsync, UIImagePickerPreferredAssetRepresentationMode, + VideoExportPreset, } from 'expo-image-picker' import {t} from '@lingui/core/macro' @@ -59,6 +60,7 @@ export async function openUnifiedPicker({ selectionLimit: IS_IOS ? selectionCountRemaining : undefined, preferredAssetRepresentationMode: UIImagePickerPreferredAssetRepresentationMode.Automatic, + videoExportPreset: VideoExportPreset.Passthrough, videoMaxDuration: VIDEO_MAX_DURATION_MS / 1000, }) }