Push Notification Service for WPF based desktop app? - c#

I need help to choose a Push Notification Service for my WPF desktop based app. I was checking on Google's Firebase, Windows Push Notification Services (WNS) etc but they all speak in context of App based environment i.e. iOS, Android or WP. Further more they have documented references for Web Apps using JavaScript.
Now i am stuck to find one which is compatible for my desktop based WPF + C# App.
Can anyone help me please?

It wouldn't work unless you convert your app (No matter if it's WPF/MFC/other desktop tech) to UWP/Store app.
Fine details are listed here:
https://msdn.microsoft.com/en-us/library/windows/desktop/mt695951(v=vs.85).aspx
Reason: WNS Push notification API doesn't support DualApiPartition attribute:
https://learn.microsoft.com/en-us/uwp/api/windows.networking.pushnotifications.pushnotificationchannelmanager

As mentioned in the comments by Wolfgang you can use Azure Notification Hubs. If you install the NuGet package Microsoft.Azure.NotificationHubs you can then use that to subscribe to notifications. It requires a minimum of .Net 4.5, so long as your WPF application is targeting that or higher you should be fine.

Related

How to send push notifications to a Blazor Maui application from backend Server

I have a Blazor Maui application where I'd like to have the option to receive push notifications on.
I'd like to send the push notifications from a server project inside the same solution where I have my Blazor Maui project. For example : the server should contain a Gui with a textbox for the title and messagebody. This should then sent to all the users who downloaded the app.
Any tutorials,links, examples, tips or recommendations on how to start this?
I followed this guide before but this is all configured inside the app itself.
Thank you in advance.
A .NET MAUI Blazor app is still a .NET MAUI app.
If you want to use push notifications, you're going to have to be on the platform level. The guide you linked might still be very useful for that.
The comment from #H.A.H. is a good option too, using SignalR, but that will only work if you're inside of the app. SignalR is not integrated into the OS like push notifications are. You are not able to get a banner in the top of the screen for instance. But definitely thanks for watching and recommending my videos ;)
If you want the "regular" push notifications, you can follow any guide that adds push notifications in a .NET MAUI app and that will work for .NET MAUI Blazor.
you can use signalr for this purpose you can go throug following link
click here

Add/Start/Stop IoT Core application from another application

I would like to add/start/stop/remove an application (IoT Core) just like the web interface or the Power Shell commands: "IotStartup" but from within a C# application running on the IoT Core itself.
Is there a c# API for this or do I have to implement the Power Shell commands inside my application?
Using the Device Portal API could work for you.
Here are the docs.
https://learn.microsoft.com/en-us/windows/uwp/debug-test-perf/device-portal-api-core
Device Portal APIs are intended for remote management, and may not work from within a UWP against localhost due to loopback restrictions in Windows (to prevent an app from attacking the device it's running on).
That said, the Windows.Management.Deployment.PackageManager class provides installation and removal APIs for apps. To launch an app, you can use Windows.System.Launcher. Note that PackageManager is a restricted capability, so the app won't be able to go into the Store without special permissions from Microsoft. It will work in sideloaded scenarios though.
There is no way to close an app from another app with existing APIs. However, Launching the app using the above, then connecting with an AppServiceConnection to manage it, you can send a "Close" message over the AppServiceConnection that causes the app to close itself.

How do I real time communicate a Universal Windows App with a older .Net 4.5 app in the same solution. IPC?

I have been struggling with this for over a month, but am slowly learning. Here is what I have:
C# Solution With 3 Projects
-Universal Windows Platform App (Cortana Voice Support)
::Above just shows a floating PNG image and is Cortana enabled
-Universal Windows Service (Cortana Background Service)
::Needed for the Cortana Support
-.Net 4.5 C# App with HTML DOM Automation
::Automates locating elements and clicking of a website
I can't re-code my .Net app's functionality in my Universal app because some of the libraries it uses won't install. (GhostDriver, PhantomJS, and a HotKey Library provided via NuGet. Installing on the Universal Platform fails on all 3 libraries).
What is needed:
-Master Universal Windows App or Service sends signal to .Net App
-.Net App receives signal and calls method/function providing my functionality.
I've never tried calling methods in other apps within the same solution and was wondering if there was a few-code workaround. What I need I think is a method of inter process communication or events, but can't find any examples of a UWP. Most are .Net communicating with other older non universal apps.
Thank you so much!
If I understand correctly, you were developing a app which will can automate the DOM operation through Cortana.
Do you need to submit this app to App Store?
If no, as Scott said, you can use WCF to communicate between UWP process and .NET 4.5 desktop app process.
If yes, as Andrew pointed out, you need an intermediate remote server hosting the service.

How to Integrate whatsapp api with c# wpf windows application pc

I am working on windows application (wpf c#), in which i have to integrate whatsapp api. So that i can post images in whatsapp using the windows application
I googled about integrating whatsapp api with c# wpf, but didnt find a proper solution.
Can you please guide me about how to integrate whatsapps with c# wpf application or provide with some useful links
I guess the only possible way is to build an android application to listen to your C# software and post to WhatsApp.
You can create a virtual Android OS installed on the server, and install WhatsApp and your customized application on it.
In other words, the Android application will act as an intermediate layer between the C# and WhatsApp.
Please check the following link to help you integrate your Android Application with WhatsApp:
http://www.whatsapp.com/faq/en/android/28000012
Regards,

What is the purpose of WINRT_NOT_PRESENT?

In a few Windows 8 App code samples I've seen code blocks encapsulated by these preprocessor instructions
#if !WINRT_NOT_PRESENT
#endif
Is WinRT not always present in Windows 8 Store apps?
This is used by Microsoft's NotificationsExtensions library. You need to specify this build symbol if you want to use ASP.NET to send push notifications to Windows Push Notification Services (WNS).
From Quickstart: Using the NotificationsExtensions library in your code (Windows):
You can also use NotificationsExtensions in your app server code if you are using ASP.NET to send push notifications to Windows Push Notification Services (WNS). The only caveat is that you must add the WINRT_NOT_PRESENT compilation build symbol in the NotificationsExtensions project properties.

Categories