[英]The module react-native-image-picker in iOS always requires microphone permissions although I don't select video, only camera
我正在使用react-native-image-picker(拍照/選擇照片)將它們上傳到我的服務器。 它完美地運作。
為此,我使用ImagePicker。 當我注意到在iOS中,如果我想使用它時,模塊需要我麥克風權限。
我查看了文檔,因為它應該發生,並且他們說如果你想制作視頻,你必須擁有麥克風權限。 這似乎是一致的,問題是我只使用相機拍攝的照片,沒有視頻。
這是我的代碼:
var ImagePicker = require('react-native-image-picker');
var options = {
title: 'Adjuntar Imagenes',
takePhotoButtonTitle: 'Hacer foto',
chooseFromLibraryButtonTitle: 'Elegir foto',
cancelButtonTitle: "Cancelar",
mediaType: 'photo',
storageOptions: {
skipBackup: true,
path: 'images'
}
};
ImagePicker.showImagePicker(options, (response) => {
if (response.didCancel) {
console.log('User cancelled image picker');
}
else if (response.error) {
console.log('ImagePicker Error: ', response.error);
}
else {
var fileNamePlanB = response.uri;
fileNamePlanB = fileNamePlanB.split('/')[fileNamePlanB.split('/').length-1]
console.log(fileNamePlanB.split('/')[fileNamePlanB.split('/').length-1]);
var dataOBJ = {uri: response.uri, name: (response.fileName != null? response.fileName : fileNamePlanB ), type: response.type};
this.uploadImage(dataOBJ, this.dameRistraSubject(data));
}
});
那么,我做錯了需要麥克風許可嗎? 始終打開相機仍然可以拍照。
最后我發現了錯誤。 它與react-native-image-picker模塊沒有任何關系。 我從另一個錯誤的來源收到授權。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.