在phonegap build中使用bluetoothserial插件

时间:2014-02-09 02:38:36

标签: phonegap-plugins phonegap-build

我正在尝试使用插件进行phonegap构建: https://github.com/don/BluetoothSerial/tree/master

src代码只是一个index.html:

<!DOCTYPE html>

<html>
    <head>
        <title>Simple Serial</title>
    </head>

    <body>
        <div class="app">
            <div id="ui">
                <button id="connectButton">Connect</button>
            </div>
        <div id="message">Hello.</div>
        </div>
        <script type="text/javascript" src="cordova.js"></script>
        <script>
        alert("test");
        bluetoothSerial.isEnabled(
    function() { 
       alert("Bluetooth is enabled");
    },
    function() { 
        alert("Bluetooth is *not* enabled");
    }
);    
        </script>
    </body>
</html>

这是我的config.xml,只是带有bluetoothserial插件的示例:

<?xml version="1.0" encoding="UTF-8" ?>
    <widget xmlns   = "http://www.w3.org/ns/widgets"
        xmlns:gap   = "http://phonegap.com/ns/1.0"
        id          = "com.phonegap.example"
        versionCode = "10" 
        version     = "1.0.0" >

    <!-- versionCode is optional and Android only -->

    <name>PhoneGap Example</name>

    <description>
        An example for phonegap build docs. 
    </description>

    <author href="https://build.phonegap.com" email="support@phonegap.com">
        Hardeep Shoker 
    </author>
    <gap:plugin name="com.megster.cordova.bluetoothserial" />


</widget>

我构建的ipa无法按预期工作,我根本没有收到警报。

我做错了什么?

0 个答案:

没有答案