We have implemented PushSharp for sending push notifications to our enterprise iOS devices. This is being sent from a Windows machine and we customized the PushSharp code to be called from a console app which is scheduled to run every minute (checks SQL Server DB for push notifications to send and then sends what is returned). This all works fine, but I have been unable to find an example of how to call the feedback service with this library. I see there is a FeedbackService.cs class that looks to handle the connections with Apple's feedback service, but the documentation doesn't cover how it works or how you use it.
Does anyone have a good tutorial or an example of how to use the feedback service?
From the source code, looks like you don't use it directly.
You can register to the Events.OnDeviceSubscriptionExpired of the PushService.
The event arguments will populate the parameter deviceInfo with the apple device id.
Related
I have a C# console app that sends Push Notification to android device using Http post. following is my existing code:
sample code Using HTTP call to FCM
But now my requirement has been changed and not only sending the push message from server to android device, i also have to receive the acknowledge something from device to server i.e two way communication is needed.
The HTTP supports the one way communication( from server to client). I don't want to add an extra API which can be called from android device after receiving push either.
I came to know from the link https://firebase.google.com/docs/cloud-messaging/server that XMPP Protocol would do bidirectional support but i could not get a sample code how can i call the FCM using xmpp in C#.
*HTTP: Downstream only, cloud-to-device
XMPP: Upstream and downstream (device-to-cloud, cloud-to-device).
Can someone give me the sample code for sending push using XMPP in C# ?
It's not that easy just to receive the sample code since implementing XMPP is a huge amount of work. I myself implemented it by reading through RFC's and XEP's.
Since you have to authenticate and negotiate the connection with the server calling FCM from an own implementation is going to take even longer.
However, best thing you could and should do now, is looking for a Library on Github for example, that already implements the stuff you need.
Here are two of them, but I did not look into them:
https://github.com/ForNeVeR/Jabber-Net
https://github.com/tiagomtotti/firebaseNet
I hope they fulfill your needs.
I just started demo app for azure push notification. In my demo, I can broadcast notifications to all Windows devices but I want to send it individual user using tag. So I follow all the instructions and demo code from Azure Notification Hubs Notify Users with .NET backend.
But I getting error while sending push notification for window and WP. Here is my code :
outcome = await Notifications.Instance.Hub.SendWindowsNativeNotificationAsync(toast, userTag);
I getting follwing error :
The remote server returned an error: (400) Bad Request. The
notification has no target applications. The notification format is
windows. Review the credentials specified in the notification hub
description and the notification format.
.TrackingId:2aca8783-c5eb-41f8-a821-6f457806ca86_G7,TimeStamp:11/29/2016
1:40:07 PM
I have not register my app on windows store. I guess it is creating problem but then why it is working for broadcast? When I send it individual user with tag then it gives above error.
Please let me know where I am wrong. Is it necessary to register app on windows store for send notificaton with tag for single user?
Have you gone through Register your app for the Windows Store and Configure your notification hub?
If so, does test send (from the portal) work? (Here's an example how to do it from the classic Azure portal and Visual Studio, see "Verify message notifications" section.)
Are there any differences between the broadcast template and the one you use to send to individual users?
According the logs, the Notification Hub you use does not have WNS credentials (Package SID and secret key) properly configured. While those credentials are required.
And it is also seen that no push notification were actually sent to devices, for last 7 days at least. So, maybe another Notification Hub was used for the broadcast, and that one has all the credentials in place...
I'm creating an ios application using swift for the client and C# for the server. I currently have a web app hosted in azure that communicate with the client via web api. Now I need to employ push notifications
I'm looking at Azure tutorials as my push notification provider, but it seems that it only cares about sending mass broadcasting. My need is to send custom notifications per user/device for specific notification such as "someone liked your profile" or "someone wants to connect with you" or that sort of 1-1 notifications. But look at azure example here at the section: Update server project to send push notifications (.Net) #3, there is no indication of sending a message to only one device, but rather to any device who connect to the specific hub.
So, I think the azure tutorials are not what I am looking for.
look at this lean code: He doesn't seem to be relying on any server like azure to send his notification. He is not using a hub either. He is just sending everything from a TcpClient and his notification is direct at 1 device like need it (note the deviceID he is receiving). But I've read that you must use an APNS provider all the time, so, where is his?
so, do I have to use Azure (if I want to stick to MS) to do 1-1 push notification? Does it support that? Any good tutorial about that? Or I don't need it and just simple block of C# is enough?
(I would try the code in option #2 out, but I have to setup the certificate and report back before being allocated more time)
after much investigation and trials, I found out that I don't have to rely on azure, its push notification or anything like that. I can do the entire thing by executing C# code like #2.
All I had to do is setup the .p12 certificate and give it a password. Bring it over from Mac to my pc and executed the C# code and was able to receive notifications on my phone.
My client are currently using Google Cloud Messaging (GCM).
I've been researching this for a while but I only seem to find examples on how to send push notification with GCM to android devices using C# but I can't find anything regarding receiving/capturing push notification sent from GCM to a UWP Windows 10 application?
Is this is possible?
Can it be done without having to use Azure? I've just checked and I can see that you can set up GCM in the notification hub in Azure but my client doesn't want to use Azure if at all possible and just stick to GCM
Google Cloud Messaging is an Android only Service by Google. Every OS has it's own similar Service and they are not intoperatable.
While it would be a really cool thing to have a cross platform Notification Service, I wouldn't bet on it to happen anytime soon. Notifications are deeply integrated into the OS for reasons like battery saving and security.
All current notification Systems work very similar and sending messages to them is mostly just sending some json/xml via Http. All you have to do is distinguish between android and windows targets when sending your notification and then either post it to gmc or wns.
Find information on WNS here.
Azure Notification Hubs are just a service that do exactly that for you, so you don't have to code it yourself (with some other nice extras), but they are not required to use WNS.
I am maintaining a queue at the server end to which users can add files. And the queue on the app which shows the files that have been added by different users has to be dynamically updated. I dont want to poll the server periodically to check if there is any new item on the queue. Is there any way to notify the client app that a new item has arrived on the queue and u have to poll the server now to retrieve that file? And I dont want a push notification, as with push notification the user will be notified, i rather want the message to be handled internally and the app should poll the server when the message is received
Please let me know if you have any ideas, i am struck on my project because of this issue.
Thanks
Push notifications are exactly for that, although your app will have to register initially (for security) - http://weblogs.asp.net/scottgu/archive/2012/12/04/ios-support-with-windows-azure-mobile-services-now-with-push-notifications.aspx
Bitsian,
You can use Windows Azure Service Bus Notification Hubs. Its just released few days ago (not even a week). It will support multiplatform push nottification (ios,android,windows 8,win phone now)
http://msdn.microsoft.com/library/jj927170.aspx
Check this link. It has some great video tutorials to start on
I found an answer to my question. Its Web Sockets!! Web Sockets can be used to maintain persistent connections between client and server. And there is a library for that - SignalR
SignalR is a new library which was introduced for ASP.Net developers to build real time web applications where server needs to continuously push data to clients.
Some links for SignalR
http://blogs.msdn.com/b/webdev/archive/2012/12/17/signalr-building-real-time-web-applications.aspx
http://www.mikesdotnetting.com/Article/206/SignalR-And-Knockout-In-ASP.NET-Web-Pages-Using-WebMatrix