Trying to connect to a credit cart swiping machine using websockets. i am using react native as a POS application. I am getting the following error when i try with iOS (ipad).
{“code”: 1006, “isTrusted”: false, “reason”: “The operation couldn’t be completed. (OSStatus error -9807.)”}
Code:
const ws = new WebSocket('wss://192.168.1.2:8443');
ws.onopen = () => {
console.log("Connection Established")
ws.send('Initiate Payment');
};
ws.onmessage = e => {
console.log(e.data)
}
ws.onerror = e => {
console.log(e.message);
}
ws.onclose = e => {
console.log(e, e.code, e.reason);
}
“react”: “18.2.0”,
“react-native”: “0.74.0”,
I tried connecting through postman and i am successfully able to make connection
Carl Johnson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.