Reputation: 264
I am using Ionic and angular to make a android app to click picture. When I call the ionic-native/camera API, my android phone asks for camera and location access. My question is that why does clicking a picture ask for location? My Code
import { Camera, CameraOptions } from "@ionic-native/camera/ngx";
......
constructor(
private camera: Camera,
) {}
....
ngOnInit() {
const options: CameraOptions = {
quality: 100,
sourceType: this.camera.PictureSourceType.CAMERA,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
};
this.camera.getPicture(options).then(
(imageData) => {
this.Image = "data:image/jpeg;base64," + imageData;
this.Event.emit(this.Image)
},
}
My versions/dependencies
"@angular/core": "~10.0.0",
"@ionic/angular": "^5.0.0",
"@ionic-native/core": "^5.0.0",
"@ionic-native/camera": "^5.28.0",
"cordova-plugin-camera": "^4.1.0",
My code is working fine, the native camera is opening up, my question is why is it asking location permission to open camera
Upvotes: 0
Views: 808
Reputation: 1480
It is collecting location details to store in the EXIF data of images.
Normally, all images taken in camera have GPS coordinates or some form of location details.
Some stock camera apps has this permission as mandatory making it compulsory for that permission required to open the app. You should check if such permission can be disabled in the stock camera app and then try if you want to deny location permission.
Upvotes: 2