I am working on the React Native Application, Which requires to update Stock Prices continuously.
So for that I am trying to find out the Stable NPM Package that can help me out to Set up the Socket Connection.
This Kind of Data I need to send for Connection :
Demo subscribe event…
{
"event": "subscribe",
"data": [
8967426,
8967938, //Instrument Tokens
]
}
This will subscribe it & Observer start fetching the data using Socket. The numbers added in Data are the Instrument Tokens.
I tried to check couple of Socket NPM Packages but didn’t received any suitable options which can work for React Native Mobile App with this kind of request.
Can anyone suggest be the best option to integrate this ?
I have reviewed couple of NPM Packages :
https://socket.io/how-to/use-with-react-native
https://www.npmjs.com/package/react-native-socketio
https://www.npmjs.com/package/react-native-tcp-socket
https://www.npmjs.com/package/react-native-use-websocket
But i didn’t found any suitable option which requires to pass the URL with JWT Token & Pass Instrument IDs of Stock Items which can get prices in response observer.
Here is the Required Process :
- Pass URL with JWT Token
- Send Data that includes Instrument Ids of the Stock Item We need to observe
- Receive Live Data based on the Ids in Response