don / cordova-plugin-ble-central

Bluetooth Low Energy (BLE) Central plugin for Apache Cordova (aka PhoneGap)
Apache License 2.0
949 stars 607 forks source link

PGB shows no plugin #34

Closed JohnHigbie closed 9 years ago

JohnHigbie commented 9 years ago

Hi Don, Added the gap:plugin line to config.sys (and using the chat example for testing), but PGB shows no plugins. Is there something else I need to do here? Thanks, John

don commented 9 years ago

I don't use PhoneGap build much. From what I recall as long as you add gap:plugin into config.xml, the plugin should get installed.

<gap:plugin name="com.megster.cordova.ble" version="0.1.0" />

This plugin doesn't have Chat example, which code are you using? I'd check config.xml for syntax errors and try uploading it again.

JohnHigbie commented 9 years ago

Hi Don.

The example is from the plugin repository examples folder: https://github.com/don/cordova-plugin-ble-central/tree/d43c7423e8b4eabb1d0fc801be2449b2a9182e88/examples/redbearlab.

I added the <gap:plugin... line to the example's config.xml and put it in the www folder for upload, which is how I've been doing it with bluetoothserial. I also tried including the ble.js, and adding its path in index.html. I tried having ble.js in both the js folder and the top www folder.

Do I need to be using the plugins.xml, or is that just for building it locally?

When I say that PGB doesn't show the plugin I'm referring to the plugins tab below the update & rebuild buttons. Also, the app doesn't do anything when you click "Refresh."

Best, John

On 1/27/2015 3:42 PM, Don Coleman wrote:

I don't use PhoneGap build much. From what I recall as long as you add gap:plugin into config.xml, the plugin should get installed.

This plugin doesn't have Chat example, which code are you using? I'd check config.xml for syntax errors and try uploading it again.

— Reply to this email directly or view it on GitHub https://github.com/don/cordova-plugin-ble-central/issues/34#issuecomment-71752863.

The Hig, LLC 3410 Edgewood Dr. Vancouver, WA 98661 503-419-6252 818-479-0178 fax

THIS EMAIL AND ANY FILES TRANSMITTED WITH IT ARE CONFIDENTIAL AND ARE INTENDED SOLELY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHOM THEY ARE ADDRESSED. If you are not the intended recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. Any inadvertent receipt by you of confidential information shall not constitute a waiver of confidentiality. The sender disclaims liability for error or omissions in the content of this message that arise as a result of email transmission. If you have received this email in error, please return immediately to the sender and delete this copy from your system. Thank you for your cooperation.

don commented 9 years ago

Make sure your config.xml is valid. I needed to add

xmlns:gap="http://phonegap.com/ns/1.0"

Once the gap namespace was added PhoneGap Build showed the plugin in the web UI.

Here's my test project https://github.com/don/pgb-test

The plugin installer adds ble.js and the other files into your project. You don't need to add the javascript or a reference in index.html. The plugins.xml file tells Cordova (or plugman) how to install the plugin. The tool reads that file, you can safely ignore it.

JohnHigbie commented 9 years ago

Hi Don, I guess that was the issue. I now have your pgb-test app functioning here, but only on IOS. On a Nexus 7 tablet, the Biscuit (Red Bear BLE mini) doesn't appear in the app. The Refresh button doesn't bring up anything. Also, I tried, but wasn't able to pair with the BLE mini in Settings. Using Android 4.4.2. Any ideas? Thanks, John

On 1/28/2015 6:47 PM, Don Coleman wrote:

Make sure your config.xml is valid http://validator.w3.org/#validate_by_input. I needed to add

xmlns:gap="http://phonegap.com/ns/1.0"

Once the |gap| namespace was added PhoneGap Build showed the plugin in the web UI.

Here's my test project https://github.com/don/pgb-test

The plugin installer adds ble.js and the other files into your project. You don't need to add the javascript or a reference in index.html. The plugins.xml file tells Cordova (or plugman) how to install the plugin. The tool reads that file, you can safely ignore it.

— Reply to this email directly or view it on GitHub https://github.com/don/cordova-plugin-ble-central/issues/34#issuecomment-71959968.

The Hig, LLC 3410 Edgewood Dr. Vancouver, WA 98661 503-419-6252 818-479-0178 fax

THIS EMAIL AND ANY FILES TRANSMITTED WITH IT ARE CONFIDENTIAL AND ARE INTENDED SOLELY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHOM THEY ARE ADDRESSED. If you are not the intended recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. Any inadvertent receipt by you of confidential information shall not constitute a waiver of confidentiality. The sender disclaims liability for error or omissions in the content of this message that arise as a result of email transmission. If you have received this email in error, please return immediately to the sender and delete this copy from your system. Thank you for your cooperation.

don commented 9 years ago

PhoneGap Build issue fixed. The demo and plugin works with Android too. Discussion moved to https://github.com/don/pgb-test/issues/1