Skip to main content

Integrate Firebase Cloud Messaging in your .Net Application

Integrate Firebase Cloud Messaging in your .Net Application

You will find some components, based on Json.Net and HttpClient, that allow .Net applications to communicate with Firebase Cloud Messaging

Data contracts

We define data contracts. This classes represent data exchanged with FCM API.

About FCM Messages

NotificationMessagePayload

Message

MessagingHelper

The following static functions allow us to interact with FCM Server

Their responsabilities :

  • serialize DataContracts to JSON
  • post to FCM server using HttpClient

Message Usage

Message with data payload

Previously in this tutorial, we defined Message<T> which contains Data property (type defined with T parameter type).

In the following example, we will use it to declare a new message type DataChangedMessage which contains DataChangedMessagePayload.

DataChangedMessagePayload

DataChangedMessage

DataChangedMessage Usage