A simple library to send push notification by FastFirebase
To install FastFirebase, run the following command in Package Manager Console
pm> Install-Package FastFirebase
You can also view the package page on NuGet.
1- Install package from nuget
2- Add required services Startup class as below :
services.AddFirebase(options=>
{
options.ServerKey = "FIREBASE_SERVER_KEY";
});
3- Send push notification by using IPushService:
var serviceProvider = GetServiceProvider();
var pushService = serviceProvider.GetRequiredService();
var model = new PushJsonModel
{
deviceTokens = new string[] { "DeviceToken1", "DeviceToken2" },
title = "test",
body = "this is a test",
data = null
};
await pushService.SendPushAsync(model);