# Ionic v3 - Camera Permission

**URL:** <https://forum.ionicframework.com/t/ionic-v3-camera-permission/142399>\
**Category:** Ionic Native\
**Created:** [September 21, 2018, 2:33am UTC](https://forum.ionicframework.com/t/ionic-v3-camera-permission/142399 "2018-09-21T02:33:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinsnake](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@shinsnake](https://forum.ionicframework.com/u/shinsnake)\
**Post date:** [September 21, 2018, 2:33am UTC](https://forum.ionicframework.com/t/ionic-v3-camera-permission/142399/1 "2018-09-21T02:33:34Z")

</div>

I am trying to request camera and location permissions when the app starts. The location permission works fine, but the camera permission comes back with a status of “always\_denied”. Here’s what the code looks like:

```auto
  requestCameraPermissions(): Promise<boolean> {
    return new Promise(resolve => {
      if (this.platform.is('android')) {
        this.andPerms.requestPermission(this.andPerms.PERMISSION.CAMERA).then((result) => {
          console.log('Android Perm Request Result:', result);
          resolve(result.hasPermission);
        });
      } else {
      this.diag.requestRuntimePermission(this.diag.permission.CAMERA).then((authorization) => {
        //this.diag.requestCameraAuthorization().then((authorization) => {
        console.log(`Camera request result: ${authorization}`);
        // resolve the promise to true or false based on whether it was granted
        resolve(authorization === this.diag.permissionStatus.GRANTED);
      });
    }
    });
  }

```

The result I get back from the android permissions response is always:

> Perm Request Result: Object {hasPermission: false}

When I tried the diagnostics approach, “authorization” is always “DENIED\_ALWAYS”.

Here’s my ionic info:

> Ionic:
> 
> ionic (Ionic CLI) : 4.1.2 (C:\Users\HinesRemote\AppData\Roaming\npm\node\_modules\ionic)  
> Ionic Framework : ionic-angular 3.9.2  
> @ionic/app-scripts : 3.2.0
> 
> Cordova:
> 
> cordova (Cordova CLI) : 7.1.0  
> Cordova Platforms : android 6.3.0, browser 5.0.4, ios 4.5.5  
> Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.4, (and 7 other plugins)
> 
> System:
> 
> Android SDK Tools : 26.1.1 (C:\android\sdk)  
> NodeJS : v8.11.2 (C:\Program Files\nodejs\node.exe)  
> npm : 6.4.1  
> OS : Windows 10

This is occurring on the Android Emulator and I’m currently trying to see what happens on an iOS simulator. I’ll update with that info when it runs. My Mac is a little lightweight so sometimes it’s really slow.

But otherwise any ideas?

---

<div class="post-metadata">

**Author:** ![Unkn0wn0x](https://avatars.discourse-cdn.com/v4/letter/u/46a35a/32.png) [@Unkn0wn0x](https://forum.ionicframework.com/u/Unkn0wn0x)\
**Post date:** [September 21, 2018, 9:05am UTC](https://forum.ionicframework.com/t/ionic-v3-camera-permission/142399/2 "2018-09-21T09:05:03Z")

</div>

Maybe you are missing the permission request for the camera inside the `config.xml`?

Take a look here:

- [https://cordova.apache.org/docs/en/3.1.0/cordova/camera/camera.html](https://cordova.apache.org/docs/en/3.1.0/cordova/camera/camera.html)

Let me know, if it could help you.

Cheers  
Unkn0wn0x

---

<div class="post-metadata">

**Author:** ![shinsnake](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@shinsnake](https://forum.ionicframework.com/u/shinsnake)\
**Post date:** [September 21, 2018, 9:57am UTC](https://forum.ionicframework.com/t/ionic-v3-camera-permission/142399/3 "2018-09-21T09:57:15Z")

</div>

Hmmm. I will check but when I use the Camera.getPicture method, it asks for permission, I press Allow and then I’m able to use the camera. Even after that, when I re-run the code above, I get the same results: denied\_always or hasPermission is false. So I’m guessing I have the permissions since I’m able to use the camera functionality. I used the normal “ionic cordova plugin add cordova-plugin-camera” command to install.

---

<div class="post-metadata">

**Author:** ![shinsnake](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@shinsnake](https://forum.ionicframework.com/u/shinsnake)\
**Post date:** [September 23, 2018, 10:03pm UTC](https://forum.ionicframework.com/t/ionic-v3-camera-permission/142399/4 "2018-09-23T22:03:18Z")

</div>

Yep, that was the answer. I had the plugin installed but it didn’t put the permission in the androidmanifest.xml. So first thing I tried was just manually adding it in the config.xml and it worked. Now I’m going to try to add the usage descriptions and see if it gets added automatically. Thanks so much Unkn0wn0x!!!

---

<div class="post-metadata">

**Author:** ![Unkn0wn0x](https://avatars.discourse-cdn.com/v4/letter/u/46a35a/32.png) [@Unkn0wn0x](https://forum.ionicframework.com/u/Unkn0wn0x)\
**Post date:** [September 24, 2018, 7:24am UTC](https://forum.ionicframework.com/t/ionic-v3-camera-permission/142399/5 "2018-09-24T07:24:23Z")

</div>

I’m glad I could help you. 🙂

Cheers

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:16pm UTC](https://forum.ionicframework.com/t/ionic-v3-camera-permission/142399/6 "2021-07-19T21:16:15Z")

</div>


