How to create the webhook receiver kind of in Xamarin form(Android and iOS)? - xamarin.forms

I want to create the Xamarin Form app for both android and iOS in which when something events occurs or data update on server than server call my xamarin app and i will perform some task in my app. Push notification and SignalR both are not suitable for my case. is there anything like webhook in Xamarin form. There are many example for Web application but nothing i found in case of mobile application.

You can use the RESTful web service as a webhook.
Representational State Transfer (REST) is an architectural style for building web services. REST requests are made over HTTP using the same HTTP verbs that web browsers use to retrieve web pages and to send data to servers.
More informations you can refer to this website:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/web-services/rest

Related

Web API Response on some action completion of second app

Dear Team i am integrating two application with web api. One application is Mobile app and second one is windows application.I wanted to implement one scenario where mobile app send one request to API and on the basis of request window app perform some action and on completion of that action i wanted to send response back to the mobile app. how can i achieve this?

How to send request from server side (asp.net web api / mvc ) to xamarin forms app?

i need recommendations from you. I have a project which use web api back end and xamarin forms. Xamarin forms is multi-user apps. Depends to user location it sends post or get request to server side and some actions occur. But what to do when i need to send something to xamarin app from web api without request from it ?????? I mean when some event happen i need to send something like push notification to specific user in xamarin app ???? (like uber send notification to drivers or riders). How to implement this ???? i was thinking to use SignalR but not sure....please help ??? thnks in advance
If your goal is to implement real time communication (when the app is open or running in the background), you could use SignalR. However, SignalR won't allow you to have real notifications mechanism (i.e. getting a push notification when the app is closed and click on it to open the app). Using SignalR, your app UI would get updated if app is open but that's it because SignalR relies on active connections.
If you really want to implement push notifications, you should check the following links:
Firebase Cloud Messaging
Using FCM, app servers can send messages to a single device, to a
group of devices, or to a number of devices that are subscribed to a
topic. A client app can use FCM to subscribe to downstream messages
from an app server (for example, to receive remote notifications).
If needed: How to use it with Azure
Hope it helps!

Read Notification via web

I want to implement a push notification service. The idea is to use the GCM Service. Is it possible to read the notifications both via web app (the app is written in php using laravel) and via mobile app for the authenticated users using the same technology?
I think it is possible, I also see this tutorial that can help you to achieve that. It also use PHP as a sample, so it seems like your work will be easier:)
It explains here the basic steps that you need to achieve push notification. It has a sample code and a screenshot to make you understand more the content of this tutorial.
In developing this application, it involves two parts, a GCM Server Application that create Web application using Php to send message to User via GCM Cloud server and GCM Client Application that create Android application which receive messages sent from GCM Server Web App.
For more information you can also check this links:
Implementing Push Messaging for Chrome
How to send push notification to web browser?

Difference between ASP.NET WebHooks and Signal-R

What is the difference between the newly release ASP.NET WebHooks and Signal-R? What are the advantages or disadvantages? What are the use cases for each technology?
SignalR is for notification within an ASP.NET app using WebSockets. You can exchange event notifications through WebSockets, however it requires a constant network connection.
WebHooks are for event notification across other web applications and other external services. (Think B2B communication). For instance, you can receive a WebHook when someone sends you money to your PayPal account. PayPal fires off a POST request to your predefined URL handler and then your app does something with that notification. You pre-configure everything on the PayPal side first. You also set up an application to handle the incoming POST request. The event notification is "pushed" to you in (near) real-time. No need to hold open a network connection while waiting for events.
The two can be complementary. For example, when you receive the WebHook from PayPal, you can notify a logged in user on your webapp (using SignalR/WebSockets) that money has been received successfully.
TLDR: Event notification across different web applications
It really depends on service you want to integrate with and how. WebHooks is a simple pattern for integrating event notifications across different SaaS services. If the service you want to integrate with supports WebHooks then you can use that. If it supports SignalR then you can use that. In that sense the two are quite complementary.
Check Henrik F Nielsen post at
http://blogs.msdn.com/b/webdev/archive/2015/09/04/introducing-microsoft-asp-net-webhooks-preview.aspx

The best option for sending asynchronous callbacks from a Web API to a .NET client

I have the following scenario in my project :-
The client makes use of ASP.NET Web API to make HTTP service requests. The Web API sits on top of a couple of WCF services, which in-turn handle all the business logic. The client subscribes to a particular type of event with the Web API. Whenever the Web API receives notifications from the internal WCF services about the occurrence of the event, the Web API in-turn needs to notify (push events to) all the subscribed clients about the events along with their details.
I want to understand the different options which are available for
sending asynchronous callbacks from an ASP.NET Web API to the
clients.(Currently we are working on a prototype for which the
client is a C# Windows Forms application. Later we might opt for
ASP.NET MVC4 web application.).
I also want to know which option would be ideal to send asynchronous
notifications back to the client when the data that accompanies the notification is of large sizes. In our scenario, the notification data that is sent back from the service may be of large sizes (~ in the range of 5KB - 50 MB).
In our scenario which I described above, can SignalR be used for notifying the c# client from Web API, as and when the Web API receives the callback from the internal WCF services?
Note :- The Web API is currently hosted in a Windows Service and the client is a .NET Windows Forms application.
Any pointers to such code samples or directions on how this can be achieved would be extremely helpful.
Cheers
SignalR is a good fit for the scenario you're describing, so I'd suggest using it for the notifications (especially since you want to start with a WinForms application and later switch to browser clients - with SignalR, you'll be able to connect to the same server-side code).
However, I'd also suggest keeping the notication messages lightweight, so instead of sending the data to the client with them, I'd send a token the client can retrieve the data with from WebAPI (SignalR isn't really ideal for large file transfers).

Resources