Fix iOS 12 crashes on media selection

https://github.com/expo/expo/issues/14903#issuecomment-966161497
This commit is contained in:
Zhiyuan Zheng 2022-02-06 22:47:30 +01:00
parent ad0e55ffec
commit 545d4151aa
1 changed files with 6 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import * as ImageManipulator from 'expo-image-manipulator'
import * as ImagePicker from 'expo-image-picker'
import { ImageInfo } from 'expo-image-picker/build/ImagePicker.types'
import i18next from 'i18next'
import { Alert, Linking } from 'react-native'
import { Alert, Linking, Platform } from 'react-native'
export interface Props {
mediaTypes?: ImagePicker.MediaTypeOptions
@ -91,7 +91,11 @@ const mediaSelector = async ({
} else {
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes,
exif: false
exif: false,
presentationStyle:
Platform.OS === 'ios' && parseInt(Platform.Version) < 13
? 0
: -2
})
if (!result.cancelled) {