# How to check permissions?

**URL:** <https://community.thunkable.com/t/how-to-check-permissions/1940176>\
**Category:** Feature Requests\
**Created:** [June 25, 2022, 4:56pm UTC](https://community.thunkable.com/t/how-to-check-permissions/1940176 "2022-06-25T16:56:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hatmanactions](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/hatmanactions/32/134611_2.png) [@hatmanactions](https://community.thunkable.com/u/hatmanactions)\
**Post date:** [June 25, 2022, 4:56pm UTC](https://community.thunkable.com/t/how-to-check-permissions/1940176/1 "2022-06-25T16:56:29Z")

</div>

How can I check if the application has camera or location permissions? I am trying to do something like this (just an example):

If permission for camera is granted change text input to value “Granted”. If not change text input value to “Not granted”. I need to check it without taking a picture by camera (call Camera1’s take photo).

I found similar topic here ( [https://community.thunkable.com/t/how-do-you-use-screen1-permissions-granted-permissions-denied/65247](https://community.thunkable.com/t/how-do-you-use-screen1-permissions-granted-permissions-denied/65247) ) but I don’t have these option on my Screen1 object and got no idea where to find these parameters/variables to use it with if-else statement.  
I also tried do check it from WebView component with javascript (navigator.permissions.query) but it seems it is not supported solutions.

As for now… I don’t know how to check if permissions was granted or not and got no idea how to do this with Thunkable.

---

<div class="post-metadata">

**Author:** ![sketch](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sketch/32/109058_2.png) [@sketch](https://community.thunkable.com/u/sketch)\
**Post date:** [June 25, 2022, 5:19pm UTC](https://community.thunkable.com/t/how-to-check-permissions/1940176/2 "2022-06-25T17:19:26Z")

</div>

This is not possible,  
Thunkable Doesn’t support such a block.

---

<div class="post-metadata">

**Author:** ![hatmanactions](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/hatmanactions/32/134611_2.png) [@hatmanactions](https://community.thunkable.com/u/hatmanactions)\
**Post date:** [June 25, 2022, 9:53pm UTC](https://community.thunkable.com/t/how-to-check-permissions/1940176/3 "2022-06-25T21:53:46Z")

</div>

Ok, I found workaround for that, which I decided to share here, because maybe it will be helpful for others having the same problem. The solution is combination of javascript and post/receive message method. .

FOR CAMERA:  
This will ask for permission if it was not given before, but will not open the Camera as with “Camera1’s take photo” so it looks better.

1. I am executing javascript inside WebViewer component, which looks like this:

```auto
navigator.getUserMedia (
   {
   video: true
   },
   function(localMediaStream) {
      ThunkableWebviewerExtension.postMessage("camera-Granted");
   },
   function(err) {
      if(err.includes("denied")) {
         ThunkableWebviewerExtension.postMessage("camera-Denied");
      }
      else {
         ThunkableWebviewerExtension.postMessage("camera-Error");
      }
   }
);

```

1. I am receiving postMessage with WebViewer ReceiveMessage (if message = “camera-Granted” etc.) and inside if rule I can add any action, not only inside WebViewer component but like every event I can do normally with blocks in Thunkable.

FOR LOCATION:  
If it will throw error or latitude and logitude are null, I can assume that the permission is denied (so here no rocket scince really).

FOR MICROPHONE:  
The same way as for camera but “video” will be “audio”.

After all of that:  
Obviously it will be much more simple if Thunkable will add a feature or anything to allow to check permissions with blocks…or if Android Browser will start to support “Navigator API: permissions” for javascript.  
Anyway… I recommend in future to add to Thunkable a feature allowing to check/ permission status from the blocks area. It will be much more comfortable to use it.

---

<div class="post-metadata">

**Author:** ![dani19130a](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dani19130a/32/120952_2.png) [@dani19130a](https://community.thunkable.com/u/dani19130a)\
**Post date:** [September 20, 2022, 6:48am UTC](https://community.thunkable.com/t/how-to-check-permissions/1940176/4 "2022-09-20T06:48:38Z")

</div>

Have you tried it on iOS?

I’ve made some tests and it works fine on Android but on iOS no permission popup comes out.

Thanks  
D

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:13pm UTC](https://community.thunkable.com/t/how-to-check-permissions/1940176/5 "2024-11-08T13:13:08Z")

</div>


