Hi, i have developed a web component service form using phonegap bluetooth serial plugin. It was working till last Servoy update.
Now i get the following error.
Error while executing client side code. Please see browser console for more info. Error: ReferenceError: Bridge is not defined
I repeat, it was working fine till the last Servoy update.
Please help.
index.html
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
</title>
<script src="phonegap.js"></script>
<script src="cordova.js"></script>
<script src="cordova_plugins.js"></script>
<script src="bridge.js"></script>
<script src="push.js"></script>
</head>
<body style="margin: 0px;background-color:#ffffff; background-image:url(img/integra7.png),url(img/loading.gif); background-position: center,50% 65%; background-repeat:no-repeat;">
<iframe src="myurl" onload="Bridge.init(this);" height="100%" width="100%" frameborder="0" style=" display: block; width: 100vw; height: 100vh; transform-origin: top left;"></iframe>
</body>
</html>
config.xml
<?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.integramobilebt"
versionCode = "10"
version = "1.0.0" >
<name>Integra Mobile v2</name>
<description>
Integra Mobile - Servoy NG
</description>
<author>
Interdata Software
</author>
<plugin name="cordova-plugin-whitelist" />
<plugin name="cordova-plugin-camera" spec="1.2.0" />
<plugin name="cordova-plugin-geolocation"/>
<plugin name="cordova-plugin-bluetooth-serial" />
<plugin name="cordova-plugin-device" />
<allow-navigation href="myurl" />
<platform name="android">
<icon src="icon.png" width="72" height="72" density="hdpi" />
<icon src="icon.png" width="36" height="36" density="ldpi" />
<icon src="icon.png" width="48" height="48" density="mdpi" />
<icon src="icon.png" width="96" height="96" density="xhdpi" />
<preference name="Fullscreen" value="true" />
</platform>
<allow-intent href="tel:*" />
<access origin="http://*" />
<access origin="https://*" />
<access origin="tel:*" launch-external="yes"/>
<preference name="loadUrlTimeoutValue" value="120000" />
</widget>
bluetoothSerial.js
angular.module('idbluetoothserialIdbluetoothserial',['servoy'])
.factory("idbluetoothserialIdbluetoothserial",function($services)
{
var scope = $services.getServiceScope('idbluetoothserialIdbluetoothserial');
return {
connect: function(macAddress_or_uuid, connectSuccess, connectFailure) {
Bridge.executeMethod(connect, null, [macAddress_or_uuid, connectSuccess, connectFailure]);
function connect(macAddress_or_uuid, connectSuccess, connectFailure) {
window.bluetoothSerial.connect(macAddress_or_uuid, connectSuccess, connectFailure);
}
},
list: function(success, failure) {
Bridge.executeMethod(list, null, [success, failure]);
function list(success, failure) {
window.bluetoothSerial.list(success, failure);
}
},
write: function(data, success, failure) {
Bridge.executeMethod(write, null, [data, success, failure]);
function write(data, success, failure) {
window.bluetoothSerial.write(data, success, failure);
}
},
isConnected: function(success, failure) {
Bridge.executeMethod(isConnected, null, [success, failure]);
function isConnected(success, failure) {
window.bluetoothSerial.isConnected(success, failure);
}
},
isEnabled: function(success, failure) {
Bridge.executeMethod(isEnabled, null, [success, failure]);
function isConnected(success, failure) {
window.bluetoothSerial.isEnabled(success, failure);
}
}
}
})
.run(function($rootScope,$services)
{})