Socket tcp plugin not working on ios


#1

Hi all,

I’m trying to create a ionic (v1) app that sends commands via tcp.
For the tcp connection i use this plugin:
https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-sockets-tcp

Everything works fine on android, but when i run the app on iphone i got an error when i try to establish a connection.

This is the snippet of code i use:

function sendPacket(data, ip, port) {
	chrome.sockets.tcp.create({}, function(createInfo) {
		chrome.sockets.tcp.connect(createInfo.socketId, ip, port, function(result) {
			if (result === 0) {
				var data2send= str2arrayBuffer(data); // convert string to buffer array
				chrome.sockets.tcp.send(createInfo.socketId, data2send);
			}

			[...]
		});
	});
}

On iphone i got this error:
[NSTaggedPointerString stringValue]: unrecognized selector sent to instance 0x0a000000383939344

It occurs when i invoke the “chrome.sockets.tcp.connect” command

I don’t know what can be and how to solve… do you have any hint?
Thanks in advance