ReactNative

mail@pastecode.io avatar
unknown
javascript
2 years ago
659 B
2
Indexable
Never
  useEffect(() => {


        var ws = new WebSocket('http://192.168.0.102:8090/api/1.0/payments/get-payments-by-orderfk');

        ws.onopen = (e) => {
            const message = 'hello';
            console.log(`Sent: ${message}`);
            ws.send(JSON.stringify({ orderFk: params.order.orderPk }))
            console.log(e)
        };
        
        ws.onmessage = (e) => {
            console.log(`Received: ${e.data}`);
        };
        ws.onerror = (e) => {
            console.log(`Error: ${e.message}`);
        };
        ws.onclose = (e) => {
            console.log(e.code, e.reason);
        };




    }, [])