FireForNet.Firebase.Messaging.Android 1.0.1-preview.21

Prefix Reserved
This is a prerelease version of FireForNet.Firebase.Messaging.Android.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package FireForNet.Firebase.Messaging.Android --version 1.0.1-preview.21
                    
NuGet\Install-Package FireForNet.Firebase.Messaging.Android -Version 1.0.1-preview.21
                    
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="FireForNet.Firebase.Messaging.Android" Version="1.0.1-preview.21" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FireForNet.Firebase.Messaging.Android" Version="1.0.1-preview.21" />
                    
Directory.Packages.props
<PackageReference Include="FireForNet.Firebase.Messaging.Android" />
                    
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 FireForNet.Firebase.Messaging.Android --version 1.0.1-preview.21
                    
#r "nuget: FireForNet.Firebase.Messaging.Android, 1.0.1-preview.21"
                    
#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 FireForNet.Firebase.Messaging.Android@1.0.1-preview.21
                    
#: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=FireForNet.Firebase.Messaging.Android&version=1.0.1-preview.21&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FireForNet.Firebase.Messaging.Android&version=1.0.1-preview.21&prerelease
                    
Install as a Cake Tool

FireForNet.Firebase.Messaging.Android

Native (non-MAUI) Android platform integration for FireForNet Firebase Cloud Messaging.

About FireForNet

FireForNet is a platform-agnostic, .NET-native Firebase Client SDK developed as part of the Circuids ecosystem. It provides a consistent Firebase client development experience across .NET application environments, while allowing platform-specific implementations where Firebase requires them.

About This Package

This package provides Android-specific Firebase Cloud Messaging for FireForNet. It implements all four platform contracts (IMessagingRegistrar, IMessagingEventSource, IMessagingPermissionManager, IMessagingTopicSubscriber) over the GMS CloudMessaging transport (registration + delivery) and FireForNet's native HTTPS topic client — using FireForNet's own IFirebaseInstallations FID + FIS token as the single registration identity.

Installation

dotnet add package FireForNet.Firebase.Messaging.Android

Usage

services.AddFirebase(new FirebaseOptions { /* ... */ });
services.AddFirebaseInstallations().UseAndroid();
services.AddFirebaseMessaging().UseAndroid();

UseAndroid() fails fast at composition when AddFirebaseInstallations() has not been called: every FCM call is authenticated with FireForNet's FID and FIS token.

MAUI apps on Android should normally call UseMaui() from FireForNet.Firebase.Messaging.Maui-chained flows, which delegate to this package on the Android TFM.

Required consumer setup

1. Manifest flag (registration precondition)

The V1 registration path requires the manifest meta-data flag in your AndroidManifest.xml:

<application>
  <meta-data
      android:name="firebase_messaging_installation_id_enabled"
      android:value="true" />
</application>

Registration without the flag fails with MessagingErrorCode.FailedPrecondition naming the flag. Devices with Google Play Services below the Y2026W12 floor (261200000) also receive an actionable FailedPrecondition; no legacy fallback exists.

2. Declare the messaging service

The package manifest-merges the receiver hop automatically. You declare the service hop:

[Service(Name = "com.example.app.MyMessagingService", Exported = false, DirectBootAware = true)]
[IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" }, Priority = (int)IntentFilterPriority.Lowest)]
public sealed class MyMessagingService : FireForNetMessagingService
{
}

priority=-500 (Lowest) lets your service win intent-filter resolution. The receiver (FireForNetMessagingReceiver) and the four permissions (ACCESS_NETWORK_STATE, POST_NOTIFICATIONS, WAKE_LOCK, com.google.android.c2dm.permission.RECEIVE) are merged from the package manifest — no consumer action needed.

3. Attach the activity context (permission prompt)

Notification permission requires a resumed activity. Attach the lifecycle tracker at startup:

// In Application.OnCreate or MainActivity.OnCreate:
var activityContext = new DefaultAndroidActivityContext();
activityContext.Attach(this);

4. Initialize Messaging before MainActivity.OnCreate returns (cold-start taps)

Delivery events are raised to a scoped event source. On a cold start from a notification tap the receiver hop runs before your DI container exists, so initialize IFirebaseMessaging before MainActivity.OnCreate returns:

protected override void OnCreate(Bundle? savedInstanceState)
{
    var messaging = Services.GetRequiredService<IFirebaseMessaging>();
    messaging.EnsureReadyAsync().GetAwaiter().GetResult();
    base.OnCreate(savedInstanceState);
}

Cold-start launch payloads are retained by the bridge for one-shot consumption via GetInitialMessageAsync(); warm-start taps surface through OnNotificationOpened.

5. Notification channel (background notifications)

Background notification messages display on the channel from MessagingAndroidOptions:

.UseAndroid(options => options.DefaultNotificationChannelId = "my_channel");

Create the channel in your app; when unset or missing, the FCM fallback channel is created lazily.

Topic operations

SubscribeToTopicAsync/UnsubscribeFromTopicAsync are platform-level operations independent of RegisterAsync state: the FID and FIS token are obtained per attempt from Installations, and the public fcmregistrations.googleapis.com endpoint is called directly (30-second timeout, 2xx success, 404/403 failure, 5xx retryable).

Dependency rationale

The single third-party dependency is Xamarin.GooglePlayServices.CloudMessaging — Google's minimal, supported client for the device-internal GMS IPC that carries FCM registration and delivery acknowledgment. No Xamarin.Firebase.* packages are referenced: topics, payload mapping, permission handling, and every HTTP surface are native FireForNet code.

Platform / Framework Support

Platform / Framework Status
Android (net10.0-android, non-MAUI) Preview

Documentation

Comprehensive FireForNet documentation is being prepared for the Release Candidate stage.

Project Status

FireForNet is currently available as a Preview release and is approaching its Release Candidate milestone. APIs, package structure, and implementation details may continue to evolve before RC and GA.

The RC milestone will be followed by an extensive cross-platform validation and testing phase before the first GA release.

All FireForNet packages are part of a coordinated release train and share the same version number.

Source Availability

FireForNet is currently being developed in a private source repository during the Preview development phase. The source will be made publicly available as the project approaches its open-source phase, with the public repository established from the appropriate release milestone.

Until then, NuGet Preview packages provide the public distribution channel for evaluating and using FireForNet.

License

This package is licensed under the Apache-2.0 license.

Product Compatible and additional computed target framework versions.
.NET net10.0-android36.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FireForNet.Firebase.Messaging.Android:

Package Downloads
FireForNet.Firebase.Messaging.Maui

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1-preview.22 46 9/27/2026
1.0.1-preview.21 55 9/22/2026
1.0.1-preview.20 59 9/18/2026

v1.0.1-preview.21
- Removed the explicit Xamarin.AndroidX.Core PackageReference; GPS binding transitives flow from the binding owner (Xamarin.GooglePlayServices.CloudMessaging).

v1.0.1-preview.20
- Initial release of the Messaging Android integration package.
- Implements all four platform contracts (IMessagingRegistrar, IMessagingEventSource, IMessagingPermissionManager, IMessagingTopicSubscriber) over the GMS CloudMessaging transport and FireForNet's native HTTPS topic client, using IFirebaseInstallations FID + FIS token as the single registration identity.
- KeyStore-encrypted token storage and Custom Tabs-based flows are owned by the Auth packages; this package covers FCM registration, delivery events, permission management, and topic operations.