I want to use the camera. For this I need a permission to the camera.
I’m using ionic 6 with android API 29.
Here I see the note about Android 26 and above that resolve permissions immediately, but I didn’t find all over the web even one single example of how to do it.
I tried a lot of options but all failed. The permission is not really called and I can’t use the camera.
Any help will be very appreciated.
This is my code for now:
this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA).then(res => {
this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA).then( per => {
console.log(per);
})
})
this.camera.getPicture({
sourceType: this.camera.PictureSourceType.CAMERA,
destinationType: this.camera.DestinationType.FILE_URI
})
.then((res) =>
{
this.imgURL = res;
})
.catch(e =>
{
console.log(e);
})