Skip to content

mehdimiri/FastFirebase

Repository files navigation

What is this ?

A simple library to send push notification by FastFirebase

Install via NuGet

To install FastFirebase, run the following command in Package Manager Console

    pm> Install-Package FastFirebase

You can also view the package page on NuGet.

How to use ?

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:

FastFirebase.Example.Console

FastFirebase.Example.MvcCore


      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);