I've integrated a phonegap/cordova plugin for sockets on Android, but I'm facing issues getting it to work. The plugin can be found here.
Upon checking the log messages "debug 1" and "debug2", it seems that creating the socketHandle object is successful. However, the problem arises at socketHandle.open. The console error message reads as follows:
Console Log
file:///android_asset/www/cordova.js: Line 927 : Uncaught TypeError : undefined is not a function
JS Code
console.log("debug 1");
var socketHandle = new Socket();
console.log("debug 2");
socketHandle.open(
"192.168.1.15",
51213,
function() {
alert("success");
// invoked after successful opening of socket
},
function(errorMessage) {
alert("failed");
// invoked after unsuccessful opening of socket
});
console.log("debug 3");
cordova.js Line 927 (within androidExec function):
var messages = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson);
I've experimented with other socket plugins, but encountered the same issue every time. Any assistance or guidance would be greatly appreciated.