Я пытаюсь реализовать плагин Bluetooth, используя Onsenui в Monaca IDE. Я продолжаю получать сообщение об ошибке: bluetoothSerial не найден.
Я хочу создать службу, для которой требуется подключаемый модуль Bluetooth Serial. Затем просто вызовите это, чтобы выполнить вызов .isenabled(). Любая помощь будет здорово.
app.service('iBeaconService', function() {
var bluetoothSerial = new cordova.plugins.bluetoothSerial;
return {
sendMessage: function(message) {
// interact with bluetoothSerial
}
};
});
app.controller('InfoPageCtrl', ['$scope', 'iBeaconService', function($scope, iBeaconService) {
bluetoothSerial.isEnabled(
function() {
console.log("Bluetooth is enabled");
},
function() {
console.log("Bluetooth is *not* enabled");
}
);
}]);
app.controller('AppController', function($scope) {
$scope.load = function(page) {
$scope.mySplitterContent.load(page)
}
$scope.open = function() {
$scope.mySplitterSide.open();
}
});
<ons-list ng-controller="InfoPageCtrl">
<ons-list-item class="list-item-container" >
<ons-row>
<ons-col width="110px">
<img src="{{beacon.icon}}" class="info-page-img">
</ons-col>
<ons-col>
<div class="info-page-description">
<p style="text-decoration: underline;">UUID</p>
{{beaconUuid}}
</div>
</ons-col>
</ons-row>
</ons-list-item>
</ons-list>