Files
2021-02-22 18:50:47 -08:00
..
2021-02-22 18:50:47 -08:00
2020-12-11 18:35:54 +01:00
2020-09-22 20:24:01 +02:00
2020-12-11 18:35:54 +01:00
2020-09-22 20:24:01 +02:00

socket-io

How to use

Running the app

  • Run yarn or npm install
  • Open app with expo start, try it out.

Running the server (optional)

  • cd into the backend directory and run yarn or npm install, then run yarn start
  • Install ngrok and run ngrok http 3000 and copy the https url that looks something like this https://f7333e87.ngrok.io. This is required because WebSockets require https.
  • Open app/main.js and change the SocketEndpoint at the top of the file to point to your endpoint.

The idea behind the example

React Native provides a socket-io compatible WebSocket implementation, some people get tripped up on the https requirement so this example helps to clarify how you can get it running.