بنقرة واحدة
shiny-firebase
// Guide for implementing Firebase Cloud Messaging push notifications in .NET MAUI apps using Shiny.Push.FirebaseMessaging on iOS and Android.
// Guide for implementing Firebase Cloud Messaging push notifications in .NET MAUI apps using Shiny.Push.FirebaseMessaging on iOS and Android.
Generate code using Shiny.Speech for cross-platform speech-to-text, text-to-speech, audio capture, and audio playback with pluggable cloud providers
Generate code using Shiny Aspire integrations — Orleans ADO.NET hosting and Gluetun VPN container routing
Generate code for Shiny.AiConversation - a centralized AI service library for .NET MAUI apps with chat client abstraction, wake word detection, speech-to-text/text-to-speech, acknowledgement modes (None/AudioBlip/LessWordy/Full), persistent message store, optional AI chat history lookup tool, and configurable sound effects
Generate code using Shiny.BluetoothLE.Hosting, a BLE peripheral hosting library for .NET with GATT server, advertising, and managed characteristic patterns
Shiny BluetoothLE client/central operations for scanning, connecting, and communicating with BLE peripherals
Core infrastructure, hosting, DI, key-value stores, lifecycle hooks, and platform abstractions for Shiny on .NET MAUI, iOS, and Android
| name | shiny-firebase |
| description | Guide for implementing Firebase Cloud Messaging push notifications in .NET MAUI apps using Shiny.Push.FirebaseMessaging on iOS and Android. |
| triggers | ["firebase","FCM","firebase cloud messaging","push notifications firebase","AddPushFirebaseMessaging","FirebaseConfiguration","GoogleService-Info.plist","google-services.json","firebase push","firebase messaging"] |
Shiny.Push.FirebaseMessaging provides Firebase Cloud Messaging (FCM) push notification support for .NET MAUI applications on iOS and Android. It wraps the native Firebase iOS SDK (via Slim Bindings) and Android FCM through the Shiny Push infrastructure.
Shiny.Push.FirebaseMessaging
using Shiny;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseShiny(); // Required
// Option 1: Use embedded configuration (GoogleService-Info.plist / google-services.json)
builder.Services.AddPushFirebaseMessaging();
// Option 2: Use embedded configuration explicitly
builder.Services.AddPushFirebaseMessaging(FirebaseConfiguration.Embedded);
// Option 3: Manual configuration
builder.Services.AddPushFirebaseMessaging(new FirebaseConfiguration(
UseEmbeddedConfiguration: false,
AppId: "your-app-id",
SenderId: "your-sender-id",
ProjectId: "your-project-id",
ApiKey: "your-api-key"
));
// With a custom push delegate
builder.Services.AddPushFirebaseMessaging<MyPushDelegate>();
return builder.Build();
}
}
public class MyPushDelegate : IPushDelegate
{
public Task OnReceived(PushNotification notification)
{
// Handle incoming push notification
return Task.CompletedTask;
}
public Task OnTokenChanged(string token)
{
// Handle FCM token changes - send to your backend
return Task.CompletedTask;
}
public Task OnEntry(PushNotificationResponse response)
{
// Handle when user taps on a notification
return Task.CompletedTask;
}
}
| Parameter | Type | Default | Description |
|---|---|---|---|
UseEmbeddedConfiguration | bool | true | Use platform config files (GoogleService-Info.plist / google-services.json) |
AppId | string? | null | Firebase App ID (required if not using embedded config) |
SenderId | string? | null | Firebase Sender ID (required if not using embedded config) |
ProjectId | string? | null | Firebase Project ID (required if not using embedded config) |
ApiKey | string? | null | Firebase API Key (required if not using embedded config) |
DefaultChannel | NotificationChannel? | null | Android only - default notification channel |
IntentAction | string? | null | Android only - custom intent action |
GoogleService-Info.plist to your iOS project (if using embedded configuration)BundleResourcegoogle-services.json to your Android project root (if using embedded configuration)The iOS implementation supports topic subscriptions through IPushTagSupport:
// Inject IPushManager
var push = services.GetRequiredService<IPushManager>();
// Cast provider to access tag support
if (push is IPushTagSupport tagSupport)
{
await tagSupport.AddTag("news");
await tagSupport.RemoveTag("promotions");
await tagSupport.SetTags("news", "updates");
await tagSupport.ClearTags();
var currentTags = tagSupport.RegisteredTags;
}
AddPushFirebaseMessaging(FirebaseConfiguration? config = null)Registers Firebase push notification services. Pass null or omit for embedded configuration.
AddPushFirebaseMessaging<TPushDelegate>(FirebaseConfiguration? config = null)Registers Firebase push with a custom IPushDelegate implementation that handles notification events.
Shiny.Push.FirebaseMessaging/FirebaseConfiguration.cs - Configuration recordShiny.Push.FirebaseMessaging/Platforms/Shared/ServiceCollectionExtensions.cs - DI registrationShiny.Push.FirebaseMessaging/Platforms/iOS/FirebasePushProvider.cs - iOS FCM provider