Getting the lay of the land

In this chapter, we are going to build a chat application that is hauntingly reminiscent of the one that we saw in Chapter 5, Real-Time Data and WebSockets. The big difference, of course, is that our client will be an Ionic app this time, which will be able to interact fully with browser clients that are also connected to the same server. In doing so, we demonstrate how easy it is to build apps that almost seamlessly interact with apps on other platforms that use the same server.

What we will need

To get our app working, we will need:

  • A server that can both receive and relay messages via WebSockets.
  • An app that can connect to a server using WebSockets and send, receive, and process messages over the same protocol. All the sent data should be rendered in a way that is meaningful to the user.

In the spirit of this book, we will of course use Node.js for our server. To add WebSocket support to it, we will use the socket.io library, which you already saw in Chapter 6, Introducing Ionic.

For the client, we will use the standard socket.io client library, which was seen in Chapter 5, Real-Time Data and WebSockets, (observed a trend here?). However, we will make some clever use of it in order to make things work smoothly on the app side of things.

Let's go ahead and start setting things up!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.88.62