public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Forms.Init(); BleAdapterConfiguration adapterconfig = new BleAdapterConfiguration(); adapterconfig.ShowPowerAlert = true; adapterconfig.DispatchQueue = new CoreFoundation.DispatchQueue("acrble"); adapterconfig.RestoreIdentifier = "pluginbluetoothle";//fails when uncommented //adapterconfig.RestoreIdentifier = "acr"; //works fine //adapterconfig.RestoreIdentifier = "acr2"; //works fine //adapterconfig.RestoreIdentifier = "pluginbluetoothl"; //works fine //adapterconfig.RestoreIdentifier = "pluginbluetoothle2"; //works fine //adapterconfig.RestoreIdentifier = "pluginbluetoothl2"; //works fine CrossBleAdapter.Init(adapterconfig); this.LoadApplication(new App(new PlatformInitializer())); new Acr.XamForms.ItemTappedCommandBehavior(); //UIApplication.SharedApplication.IdleTimerDisabled = false; return(base.FinishedLaunching(app, options)); }
public CentralManager(BleAdapterConfiguration config = null) { this.context = new AdapterContext(config); }
public static bool UseBleCentral(this IServiceCollection builder, BleAdapterConfiguration config = null) { builder.AddSingleton <ICentralManager, CentralManager>(); return(true); }
public CentralManager(ServiceProvider services, BleAdapterConfiguration config = null) { this.context = new AdapterContext(services, config); }
public static bool UseBleCentral<T>(this IServiceCollection builder, BleAdapterConfiguration config = null) where T : class, IBleStateRestoreDelegate { builder.AddSingleton<IBleStateRestoreDelegate, T>(); builder.AddSingleton<ICentralManager>(_ => new CentralManager(config)); return true; }