The first thing we will do is create a chat service that will be used by both the iOS and Android applications. To make the code more testable and to make it easier to replace the chat service if we want to use another provider in the future, we will follow these steps:
- In the Chat project, add a reference to the Chat.Messages project.
- Create a new folder in the Chat project called Services.
- Create a new interface called IChatService in the Services folder.
- Create a bool property called IsConnected.
- Create a method called SendMessage that takes Message as an argument and returns Task.
- Create a method called CreateConnection that returns Task. The method will create and start a connection to the SignalR service. ...