Example #1
0
        public CentralContext(IServiceProvider services, BleCentralConfiguration config)
        {
            this.services = services;

            var opts = new CBCentralInitOptions
            {
                ShowPowerAlert = config.iOSShowPowerAlert
            };

            if (!config.iOSRestoreIdentifier.IsEmpty())
            {
                opts.RestoreIdentifier = config.iOSRestoreIdentifier;
            }

            if (!PlatformExtensions.HasPlistValue("NSBluetoothPeripheralUsageDescription"))
            {
                Console.WriteLine("NSBluetoothPeripheralUsageDescription needs to be set - you will likely experience a native crash after this log");
            }

            if (!PlatformExtensions.HasPlistValue("NSBluetoothAlwaysUsageDescription", 13))
            {
                Console.WriteLine("NSBluetoothAlwaysUsageDescription needs to be set - you will likely experience a native crash after this log");
            }

            this.Manager = new CBCentralManager(this, null, opts);
        }
Example #2
0
        public CentralContext(IServiceProvider services, BleCentralConfiguration config)
        {
            this.services = services;

            var opts = new CBCentralInitOptions
            {
                ShowPowerAlert = config.iOSShowPowerAlert
            };

            if (!config.iOSRestoreIdentifier.IsEmpty())
            {
                opts.RestoreIdentifier = config.iOSRestoreIdentifier;
            }

            this.Manager = new CBCentralManager(this, null, opts);
        }
 public BleCentralShinyModule(BleCentralConfiguration config) => this.config = config;
 public BleCentralShinyModule(BleCentralConfiguration config)
 {
 }