Flutter教程

BluetoothLE

Contents

This plugin has the most complete implementation for interacting with Bluetooth LE devices on Android, iOS and partially Windows. It's a wrap around randdusing/cordova-plugin-bluetoothle cordova plugin for Ionic. It supports peripheral and central modes and covers most of the API methods available on Android and iOS.

https://github.com/randdusing/cordova-plugin-bluetoothle

联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.

Contact Us Today!

Ionic 低功耗蓝牙BluetoothLE插件的安装(Installation)

ionic cordova plugin add cordova-plugin-bluetoothle npm install @ionic-native/bluetooth-le
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/bluetooth-le

Ionic 低功耗蓝牙BluetoothLE插件支持的平台(Supported Platforms)

  • Android
  • iOS

Ionic 低功耗蓝牙BluetoothLE插件的用法(Usage)

import { BluetoothLE } from '@ionic-native/bluetooth-le/ngx';


constructor(public bluetoothle: BluetoothLE, public plt: Platform) {

 this.plt.ready().then((readySource) => {

   console.log('Platform ready from', readySource);

   this.bluetoothle.initialize().then(ble => {
     console.log('ble', ble.status) // logs 'enabled'
   });

  });
}