Setting up mobile projects
Now we move back to the mobile side; in our mobile projects we are going to be setting up SignalR clients on both Android and iOS natively. We will also be creating a presenter layer to share the UI logic between both native platforms. Open up Xamarin Studio and create a new shared project called Chat.Common
; inside this project add two empty folders called Model
and Presenter
.
We then want to create a single view iOS application, a general Android application and a shared project called Chat.ServiceAccess
. Our project structure will look like this:
Creating the SignalRClient
We are going to start implementing a new class called SignalRClient
. This will sit in the service access layer, the shared project called Chat.ServiceAccess
. Create a new file called SignalRClient.cs
, and implement the following:
public class SignalRClient { private readonly HubConnection _connection; private readonly IHubProxy _proxy; public...