SmoggeR_js
SmoggeR_js

Reputation: 3150

The module react-native-image-picker in iOS always requires microphone permissions although I don't select video, only camera

I'm using react-native-image-picker (to take photos / to select photos) to upload them to my server. It works perfectly.

To do this I use an ImagePicker. The problem comes when I notice that in iOS, if I want to use it, the module requires me the microphone permissions.

I've looked in the documents because it should happen and they say that if you want to make videos you have to have the microphone permissions. It seems consistent, the problem is that I only use the camera to take only pictures, no video.

This is my code:

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)); 
    }
});

So, I'm doing something wrong that requires microphone permission? Always open the camera to still make a picture.

Upvotes: 4

Views: 1123

Answers (1)

SmoggeR_js
SmoggeR_js

Reputation: 3150

Finally I found the mistake. It has no relationship with the react-native-image-picker module. I was receiving authorizations from another wrong source.

Upvotes: 4

Related Questions