Create Push notifications for Xamarin.Android without using FCM - c#

I'm creating a xamarin.forms application and have got most of the app completed. My only hickup is push notifications. I'm sending my notifications to the app using SignalR and a .Net Web API Server. I'm able to receive notifications while the app is running however, I can't see tutorials for push notifications while the app is asleep. I've checked out services as well. Thank you for you help in advance.

SignalR is not a push notification and there is a difference between them.The main difference is that in case of SignalR you have to keep an opened connection to your hub in order to receive events / signals. So if you want to receive notifications while the app is killed or in background SignalR is a wrong solution since it is technically impossible to keep your application always running on a mobile device. However, push notification can awake your application when it is killed or in background.
I would suggest to rethink your current solution instead of looking for hacks.

Related

Xamarin Firebase push notification - intermittent duplicate push notification received on Android

My Android APP is written in C#, it uses Azure Push Notification service to send push notification to Android via Firebase (FCM), iOS via Apple Push service. The push notification registration happens when the app is installed (the app also removed all previous registrations).
The push notification on iOS is working perfectly.
On Android, sometimes it receives duplicate notifications:
intermittent (not always)
on some devices only
happen on all scenarios when app is in foreground, background, killed
duplicate notifications received at the same time
and based on my DB record, i'm sure the application sends out only 1 notification.
I had suspected the registration process caused the duplicate token in FCM. But later on I found out the duplication happens out of the blue, without any new uninstall/install happened on the device.
Any idea please? this has taken a lot of my time.
This same issue I also had. To solve it, before you register with the Notification Hub, unregister the previous tags belongs to that device,
await Task.Run(() =>
{
hub.Unregister();
});
Then you register with the Notification Hub again.

Can I get a simplified list of steps required to receive Google Drive API push notifications in UWP app?

I understand that there needs to be a way to LISTEN for incoming notifications to my app, but I'm not sure where to begin to set that up. Can I at least get a starting point from someone with experience setting this up. There does not seem to be any documentation available anywhere. Thanks
No matter how you push the notification to your UWP app clients, the underlying principle is based on WNS. Then, whether you use Google Drive API or some other ways, the notifications are the same in UWP.
So, you could use UWP APIs to listen when the notifications are received. For example, you could use Notification listener.
In general, we setup a background task with UserNotificationChangedTrigger to enable an app to listen to notifications.

Xamarin.Forms Notification Service for Android

I'm relatively new to Android app development and Xamarin.Forms development in general, so I'm looking for an advice on what is the best way to implement the following:
When active, my app downloads data using a simple REST appi service (I'm using a HttpClient for this). Now what I want is when the app is closed, to still check if some data is changed on the server, using the same method as it was used when the app is running, and if so, to fire up the notification to the user.
I've been reading about the services, and that seems like a solution to my problems, but what I need to know is: what kind of service is most suitable for this task? Is it a Bound service, Intent service or Started service? Or is there a way to achieve this without the use of the service?
azure notification hubs sends to apple and google play

Apple Push Notifications dropped from Azure

I have developed a ASP.NET MVC web application that exposes several APIs. One such API is to send a push notification via apple APNS to users. In my c# code i run parallel tasks for each notification that should be sent out. We are then calling Apple APIs direct. Some users are complaining that intermittently they do not receive push notifications. I wanted to know if there are some things to be aware of when attempting to send push notifications from Azure?
Thanks in advance.

Windows Phone App Background HTTP Connectivity

I am working on developing a non-VoIP Windows Phone application that needs to have a background HTTP connection to be notified when new messages are received. I noticed for Windows Store apps, there is an example for ControlChannelTrigger that allows you to connect an HttpRequestMessage and will send a push notification to the app when data is returned by the http request.
Is there a similar concept that I can use for Windows Phone, because just using a Periodic Task really isn't good enough.
You cannot do that with Windows Phone. Once your app is not on the foreground anymore, there is no way for it to maintain a connection.
You should instead look into push notifications implementation here.
There was a trick where you could use a background audio agent to maintain the connection but I don't think it's still doable. And is considered a very bad practice from both a developer and a user points of view.
So you should just go with the standard push notification thing linked above.

Categories