FcmSharpClient 1.0.0

dotnet add package FcmSharpClient --version 1.0.0
NuGet\Install-Package FcmSharpClient -Version 1.0.0
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="FcmSharpClient" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FcmSharpClient --version 1.0.0
#r "nuget: FcmSharpClient, 1.0.0"
#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.
// Install FcmSharpClient as a Cake Addin
#addin nuget:?package=FcmSharpClient&version=1.0.0

// Install FcmSharpClient as a Cake Tool
#tool nuget:?package=FcmSharpClient&version=1.0.0

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

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 sendResult = await fcmClient(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 sendResult.failedSends) {
    // clean up failed tokens
  }
}
catch (FcmSendException) {
  // can and will occurr for invalid api keys or failed http connections
}
Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in 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
1.0.0 5,793 8/3/2018