FcmClient 1.0.1

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package FcmClient --version 1.0.1
                    
NuGet\Install-Package FcmClient -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FcmClient" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FcmClient" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="FcmClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FcmClient --version 1.0.1
                    
#r "nuget: FcmClient, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FcmClient@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FcmClient&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=FcmClient&version=1.0.1
                    
Install as a Cake Tool

Firebase Messaging Client for C#

This is a C# library to send messages via FCM directly to known device tokens. If this doesn't make sense to you, this library is not for you.

Usage

Install nuget package

Install-Package FcmSharpClient -Version 1.0.0

To use the FcmClient you require the FCM Api-Key, which you can get from your Firebase console: https://console.firebase.google.com/project/(your-project-id)/settings/cloudmessaging

You will also need to create an HttpClient and manage its lifecycle by yourself.

    var httpClient = new HttpClient();
    var fcmConfiguration = new FcmConfiguration("YOUR-API-KEY");
    var fcmClient = new FcmClient(fcmConfiguration, httpClient);

With the FcmClient ready you can now send a message directly to one or more known device tokens.

    try {
      var result = await fcmClient.Send(new string[]{ "fcm_token" },
        "displayed title", "displayed message", // both visible when the app receives the push message
        new { key = "value" } // an optional json serializable object that can be processed by your app
      );
      foreach (var failedToken in result.FailedSends) {
        // clean up failed tokens
      }
    }
    catch (FcmSendException) {
      // can and will occur for invalid api keys or failed http connections
    }
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated

Migrate to modern configuration