Allow app permission to use Bluetooth (pop-up shuts down app)

Assuming this is something I can run in an activity starter like the below scenario:
android.bluetooth.adapter.action.REQUEST_ENABLE

just dont know what the command is required for this particular instance. works if i go to settings and allow permissions - but thats the long way of course.

Hello @Reality_Bytes ,
You might want to use the AskForPermission in the Screen component.
component_method

Your App will automatically trigger the pop-up asking for Bluetooth permission when the App attempts to enable Bluetooth.

long time no talk @ChrisWard , you've always been exceptionally helpful in the past and I very much appreciate all the time you spend here helping folks.

This is an app I made and used for a long time where either an app inventor update or a phone update is pushing this new scenario asking for "permission".

here is my old/current setup where i've never seen this permission deal till now.
the activity starter action reads "android.bluetooth.adapter.action.REQUEST_ENABLE"
(never had this error before)

I figured this error message being permission related that its different than an enable deal - I could be entirely wrong.

also, this is on classic BT - which I might move away from given the unfortunate HC-06/HC-05 issues I've seen lately. thats a me rant for a different post though lol

permission1
permission2

Ive never noticed this before . . . interesting.
do you know which i need to select?
(since I have to download and open the APK on my phone to get the error - prefer to not play guess and check given how long that takes in this case)

This is a new requirement for SDK31.. see here what needs to be done

Taifun

2 Likes

thank you!
and thank you for spending all the time to make your extensions.
there's a few of you folks here that this whole platform would not be the same without.

your collective efforts are noticed and remembered.

below works - I put it in my program a little different, but its the same difference.
I dont know if this would pop up everytime the app is opened or not - I should have tested that.

the way I run my BT is that after connected to a device, that address is saved to tinyDB. on app initialization, if there is a mac address, the app will try to auto connect to that source.
the way I integrated the below suggestion into my code was to look to see if there was a mac address saved or not since permission would have to be allowed in order to ever be able to connect to anything.
so if there ISNT a mac address ("variable = tinyDB, is variable length greater than x") , it runs the below scenario.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.