question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.netMaui GA Android BluetoothLE: Stumbled at using RequestPermissions

See original GitHub issue

Hi, I have great hopes for this. So trying to follow the example at https://github.com/inthehand/32feet/wiki/Bluetooth-Low-Energy

So I nuget the InTheHand.BluetoothLE 4.0.24 I add the line

RequestPermissions(new string[] { Manifest.Permission.AccessCoarseLocation, Manifest.Permission.BluetoothAdmin }, 1);

I get the red wavy lines under RequestPermission and Manifest

I assume? that I need to use

using InTheHand.Bluetooth;  (I expected BluetoothLE, but not in the intellisense,  as I don't want to use Bluetooth classic?)

However the red wavy lines don’t disappear.

What stupid thing am I doing (or not doing) 😦)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gfmoorecommented, Jun 11, 2022

The following post https://gist.github.com/salarcode/da8ad2b993e67c602db88a62259d0456 shows how to add theBluetooth permissions. It seems to be working as for my app it now seems to have Bluetooth permission options. It doesn’t display a popup requesting access. I don’t yet know if that is something Android automatically does or it’s what needs to be written for Maui. For example requesting Location permission results in a very pretty popup.

Anyway it’s progress and maybe can be improved?

The source thread for this is https://github.com/dotnet/maui/discussions/277

0reactions
peterfootcommented, Jun 13, 2022

I’ll add a link to that post to the Wiki. It’s a good sample because it covers all the different Android versions where different permission combinations are required. Ultimately it would be good to either include a maui permission in this library or submit it to the maui essentials library so that it is always available out of the box.

Read more comments on GitHub >

github_iconTop Results From Across the Web

.net Maui Bluetooth LE - Run-time permissions check and ...
I'm just starting now with BLE and MAUI app development then I've tested the app by using my phone as Android Emulator in...
Read more >
Check and Request Permissions in .NET MAUI - YouTube
NET MAUI and how to extend it with custom permissions. ... cross-platform API, and then implement custom bluetooth permissions for Android !
Read more >
Permissions - .NET MAUI
This class allows you to check and request permissions at run-time. The Permissions type is available in the Microsoft.Maui.ApplicationModel ...
Read more >
.NET MAUI does not work with Android 13 ...
The app can't work without media picker (MediaPicker control), but it seems to rely on WRITE_EXTERNAL_STORAGE only, which is not in the list...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found