我正在研究钛合金的一个项目。我需要使用 Beacon 模块来使用 BLE 扫描信标。我的问题是我无法让模块工作。
我使用安装移动模块来安装模块,并在 tiapp.xml 文件中启用它。
这是我目前拥有的代码:
var Beacons = require('com.logicallabs.beacons');
function doClick(beacon) {
if(Beacons.BeaconsModule.isEnabled()){
alert('succes');
}else{
alert("suces");
}
}
$.index.open();
当您单击标签时,该功能将启动。该模块包含 3 个类。您是否必须指定必须使用哪个类的哪个方法?
另外,当我启动该程序时,我会收到错误消息,Could not find class 'android.bluetooth.BluetoothManager
并且Could not find class 'com.logicallabs.beacons.ScanService$2