Xamarin.iOS - Client.PairedDevices does not return the devices

Riya Parmar 0 Reputation points
2024-03-21T14:06:14.61+00:00

I am using this 32feet Library (InTheHand.Net.Bluetooth - Bluetooth Classic NuGet package) to get a list of paired devices In my Xamarin.Forms app. I can get a device list in Android but not in iOS. when I call to BluetoothClient.PairedDevices, it returns values when on Android, but on iOS it's always empty.

Does this library have support for iOS or is there any mistake in the code, do we have to add any configuration in info.plist file?

I am attaching the code for reference(which is in C#).

BluetoothClient client = new BluetoothClient(); foreach (var device in client.PairedDevices) { GeolocationDevices.Add(device.DeviceName); }

Here, is the permission I allow in info.plist file Info.Plist file

Can anyone suggest me an idea if I am missing anything regarding provisioning profiles, info.plist permissions etc.

Thanks in advance.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,263 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,286 Reputation points
    2024-03-21T16:44:05.6666667+00:00

    IOS security does not allow listing paired devices. see:

    https://wojciechkulik.pl/ios/swift-bluetooth-low-energy-how-to-get-paired-devices