Shiny.NET
Getting Started

Bluetooth LE is divided into 2 separate categories - the central manager (client) and the peripheral manager (server).

|Area|Info| |---|---| |Description|| |Service|Shiny.BluetoothLE.IBleManager| |NuGet|| |Static Generated Class|ShinyBle|

services.UseBleClient<Shiny.BluetoothLE.IBleDelegate>();

services.UseBleClient(); services.UseBleClient

Minimum Version: 8.0

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.org.yourapp" android:installLocation="preferExternal">
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
</manifest>

Minimum Version: 10

Info.plist

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE plist PUBLIC " -//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>Say something useful here that your users will understand</string>
    <key>NSBluetoothAlwaysUsageDescription</key>
    <string>Say something useful here that your users will understand</string>
    <key>UIBackgroundModes</key>
    <array>
        <string>bluetooth-central</string>
    </array>
</dict>
</plist>

Package.appxmanifest

<?xml version="1.0" encoding="utf-8" ?>
<Package>
    <Applications>
    </Applications>
    <Capabilities>
        <DeviceCapability Name="bluetooth" />
    </Capabilities>
</Package>

Setup

  1. Add the following to your Shiny Startup
using Microsoft.Extensions.DependencyInjection;
using Shiny;

namespace YourNamespace
{
    public class YourShinyStartup : ShinyStartup
    {
        public override void ConfigureServices(IServiceCollection services, IPlatform platform)
        { 
            
services.UseBleClient();
 
        }
    }
}