Subash Acharya
Subash Acharya

Reputation: 11

Sending Push Notification using XMPP with c# console app for getting Acknowledgemet back to server from client

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# ?

Upvotes: 1

Views: 573

Answers (1)

Tubif Fux
Tubif Fux

Reputation: 146

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.

Upvotes: 0

Related Questions