FcmSharpClient 1.0.0
dotnet add package FcmSharpClient --version 1.0.0
NuGet\Install-Package FcmSharpClient -Version 1.0.0
<PackageReference Include="FcmSharpClient" Version="1.0.0" />
paket add FcmSharpClient --version 1.0.0
#r "nuget: FcmSharpClient, 1.0.0"
// 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 | Versions 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. |
-
- Newtonsoft.Json (>= 11.0.2)
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,804 | 8/3/2018 |