Show desktop notification from one windows app (WPF) to another using webservice call - wpf

I have created WPF app and installed in two different PC. now I want that when I click one button from app in 1st PC, then I should get desktop notification in 2nd PC.
So I don't know how it will be done. Whether I have to use WCF or not or anything else? If I've installed this app in multiple PC then how should I send notification to particular?
I've tried to use signalR but I didn't understand how to invoke windows form method.
The application will not be closed. it'll just minimized in the tray. so my idea is that we can invoke App method from using WCF and show notification.
I want this kind of notification for my app but from webservice:

You can use self hosted WCF like here:
https://msdn.microsoft.com/en-us/library/ms731758(v=vs.110).aspx
Use net tcp binding, it will not require administrative rights.
Also there is a need to maintain a list of addresses/hosts of the PCs where your app runs. Then according to some logic you have there, choose the one that should show your notification.
You can also use a central app that coordinates, it may be a web app. Then signalR can be helpful. It becomes like a standard chat app... google can find you plenty of implementations for that.

Related

What's the best way to send event notifications from a Winforms server application to a Blazor client application?

A few years ago I was instructed to build an Windows Desktop application to control several devices, add and check data from a local database among other stuff. At the time the answer was very simple and I decided to create a WinForms application that provided a solution to the request, the app would control the devices, it would store data in a local database and it would show the data in it's UI.
Even though it worked perfectly for a while, the project has now expanded a lot, to the point were it consists in several projects including two REST API services working on different servers as windows services, a Xamarin Android and iOS apps that access those servers and some other stuffs. Obviously, my dicision of not separating the original Winforms server application's UI from the server stuffs has kick me in the rear. Another problem is that the solution has been working for a long time and the client does not want to give me much time for updating (which by the way it would probably require to rethink everything) so he want me to give him a fast and simple solution to the problematic server - client scheme.
So again I decided to try a fast solution (probably not the right one, but its a matter of time) and created a Blazor app that connects to the local database and it would work in the same server where the winforms app is, guaranteeing that none one will touch that app.
The problem now is that I need a way to show real time notifications in the blazor web UI and update its datagrids, etc., when the winforms app receive an event from one of the devices. At first I thought of SignalR, being the blazor app the server for SignalR and the winforms just a client, but I have no experience with it. Although if SignalR is the answer I'll deal with it.
So, the question is: which is the best way to send real-time event notifications from a winforms application to a blazor app?
Thanks in advance

Background task on iOS

I plan to create a business app that runs on iOS and communicates with a webservice. The app is meant to be an online app, but when there is no internet connection, the user should still be able to register a notification locally and the app should send the notification automatically (without further user intervention) as soon as there is an internet connection again. This should also work when the user closes the app while he has no internet connection.
Is it possible to do this on iOS? (I know it works on Android with a service)
Does this need a special permission ?
Thanks
Check out this developer guide section, specifically the part about local notifications in iOS and Android.
Notice that services can work in native code but the local notifications are portable.

make C# window application as window service

I have a desktop application in C# and i want to make that a window service. Is it possible to make that application as a windows service? Basically i want an app that shows gui when needed and upone minimizing it goes to system try, and it should also appear in services... For application just take an example that my application have a timer and multiline text field and its also interacting with database and its showing timely status from database so when i need to see it i can start GUI from system try?
Any kind of help would be highly appriciated. Thanks!
You will need to separate your applications. Windows Service and desktop. You will need to build API hooks into your Windows Service to allow communication from your desktop application and the service. I would recommend WCF for this.
In a nutshell, a Windows Service should not interact with the desktop. It will run in a separate session than the session you are logged into, even if you are logged in as the same account the service is running under.
It is not possible to show GUI in a windows service.
What you can do is:
a. Seperate client logic from server logic, the windows service will perform the server side operations and will expose a WCF API to the client , which will handle the GUI related issues.
b. Use an external tool like Service-O-Matic to control your winforms application as if it was a windows service. see:
http://www.kwakkelflap.com/service.html

Send simple data from wp7 to winforms application

I want to send simple data (geolocation data to be precise) from Windows Phone 7 application to a windows forms application and use it, as I'm a total beginner in this field I don't know which tools to use.
I searched about wcf services and tested this method but there's some issues: the data is sent from the phone application but isn't sent to the winforms application (guess something is missing)
If your know how to do this in a quick way, or have good tutorials I'll be thankful.
EDIT
I found this tutorial, it show how to connect directly wp7 application and desktop application without using sockets neither wcf service, I'm wondering if it is really works if the application isn't in localhost.
the like for the tutorial: wp7 tutorial
I had a similar problem and so I created a REST/JSON WCF service hosted in IIS with AppHarbor to provide the data. There's hundreds of ways to do it (Ruby/Heroku, etc..), but that particular one fits well within the Microsoft stack. I also needed to share route data and I used the WCF service to wrap the BingMaps services so that route computations are cached and shared. Considering that I had already created a local model, moving it out of my phone project into a service took less than a few hours (including the usual config hiccups, and forgetting to add the appharbor user to my bitbucket repo).
Consuming the service from WinForms (or any client) shouldn't be an issue as the service knows nothing about the client implementation.
Here's a tutorial from code project. REST WCF Service with JSON
I think you would need to implement some sort of server side solution which you could upload to on your Windows Phone and download from on your Windows Form application. This could be achieved using a WCF service which was connected to a server side database.
Another option would be to use sockets and communicate directly with your WinForms application. Check this tutorial on how to use basic sockets on WP7.

Intercommunication between two .Net Applications using WCF service

I have a WPF application. On the same machine I have a console application.From this console application i want to see if user has successfully logged in and a particular page is open in WPF application. If this is the case then i want to show a popup in WPF application.
To implement this I Thought of using WCF services. I have got 2 options. Create a seperate WCF service and run it as soon as WPF application runs and then ask the client application to communicate.
Second option is to host the WCF service inside the WPF application and run it when WPF application starts.
I am not able to decide on which way to choose. If anyone of u has implemented this kind of setup before,please share your ideas.
Because you want to see if a page is open in the WPF application, I'd suggest hosting the WCF service in the WPF application (i.e., using the ServicHost class). Then have the console application consume the service to determine the page status as per your requirement.
Also, use the NetNamedPipeBinding (http://msdn.microsoft.com/en-us/library/system.servicemodel.netnamedpipebinding.aspx).

Resources