Get tips for real-time mobile app connection to server

lida daryani 1 Reputation point

I have a mobile app with Xamarin and a server that is the web API .NET core, Which works with http methods and the server has no views and are just api methods. What method do you suggest for real-time communication between the two? At present, the application only sends a request to the server and receives the result, but how can the server also send a request or message to the application?

A set of technologies in the .NET Framework for building web applications and XML web services.
2,596 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Zhi Lv - MSFT 18,886 Reputation points Microsoft Employee

    Hi @lida daryani ,

    You could consider using ASP.NET Core SignalR. It is an open-source library that simplifies adding real-time web functionality to apps. Real-time web functionality enables server-side code to push content to clients instantly. And the SignalR .NET client runs on any platform supported by ASP.NET Core. For example, Xamarin developers can use SignalR for building Android apps using Xamarin.Android and later and iOS apps using Xamarin.iOS and later.

    You can refer to the official document and sample code to learn how to use it, such as this link: ASP.NET Core SignalR .NET Client.

    Besides, you can also search online, there has multiple tutorials about using core SignalR with Xamarin, like this: Xamarin.Android - Realtime App with SignalR ASP.Net Core.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,