2015-07-21 166 views
0

科尔多瓦 - 插件 - 铬 - 应用程序 - 蓝牙我有插件科尔多瓦 - 插件 - 铬 - 应用蓝牙科尔多瓦 - 插件 - 铬 - 应用程序 - 共同如何运行科尔多瓦

一个科尔多瓦应用
cordova plugin add cordova-plugin-chrome-apps-bluetooth 
cordova plugin add cordova-plugin-chrome-apps-common 

我想读chrome.bluetooth.getAdapterState()

app.scan = function() { 
    console.log("app.scan()"); 
    var res = chrome.bluetooth.getAdapterState(function( adapterInfo) { 
      console.log("callback"); 
      console.log("adapterInfo"); 
     } 
    ); 
}; 
index.html中

结果:

<button on-click="app.scan()" >scan</button> 

在铬JS控制台,我可以看到app.scan(),但回调一直没有出现。

是这个插件应该在科尔多瓦真的有用吗?或者可能是我错过了什么?

+1

由于内容安全政策的Chrome应用程序,内联JS脚本不允许在这里:https://developer.chrome.com/apps/contentSecurityPolicy – gui47

回答