IsPermission Granted

Hello,
I'm using TaifunTools.
I will know when Bluetooth permission is granted


An Label3 display always "false"

I did not understand
Can you help me ?

You should use the permissions helper block or the full permission string, as indicated in the documentation. You may also need to carry out this check in a separate event.

I changed to helper block


But the result is same.

You are checking for granted before you ask for the permission. How will that work ?

Did you mean Connect or Scan ? (you just had Scan in your previous blocks)

My target is to know when the permission is granted.
The first time the application run the permission is not granted. The window appear to grant the permission. The application must work with bluetooth. So the application close. Next time the permissionis granted. (window ask for permission does not appear) But Label3 is always false

The rsult is same :slight_smile:

I have Androi 14

in your latest blocks you never asked for bluetooth connect permission, therefore obviously you always will get false as result

Taifun

Sorry, I forget :slight_smile:

why are you using TinyDB to store grantedBT?
and if you are using TinyDB, why are you not storing that flag inside the second if statement, which would make more sene?

and if you want to use the IsGranted method and you still have issues with it, post a small example project as small as possible so I can take a look

Taifun

Hello,
I will not use Tiny, but I've make a test...
A little example, so you can look.
BTclient_test2(1).aia (22.0 KB)

Sébastien

BTclient_test2a.aia (29.5 KB)

Hi Anke,
the result is right using GetAsd :slight_smile:

Returns true after the first start:

Ok, label3 display true after first start
:wink:

1 Like