Get tips for real-time mobile app connection to server

lida daryani 1 Reputation point
2021-11-10T18:48:12.397+00:00

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?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,188 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Zhi Lv - MSFT 32,016 Reputation points Microsoft Vendor
    2021-11-11T01:51:53.867+00:00

    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 8.4.0.1 and later and iOS apps using Xamarin.iOS 11.14.0.4 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 Asp.net 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,
    Dillion

    1 person found this answer helpful.