
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
The plugin includes cross-platform APIs for Firebase Analytics, Auth, Cloud Messaging, Crashlytics, Dynamic Links, Firestore, Cloud Functions, Remote Config and Storage.
This is a wrapper library around the native Android and iOS Firebase Xamarin SDKs which includes cross-platform APIs for most of the Firebase features.
Version 3.0.0 of this plugin marks a migration from the abandoned Microsoft-published Firebase iOS Nuget packages (prefixed with Xamarin.Firebase.iOS.*
this plugin previously depended on.
Public discussion of the issue can be found on MAUI's GH
There should not be any breaking API changes. However, we felt the major version bump was appropriate to communicate the significant change in the plugin's iOS binding dependencies, which are no longer sourced by Microsoft. Moving forward, this plugin will depend on a community-maintained fork of the deprecated packages published under a new package prefix AdamE.Firebase.iOS.*
The migration to AdamE.Firebase.iOS.*
packages additionally bumps underlying native Firebase iOS SDKs to version 10.24.0. This is a significant upgrade from the previous latest-available version supported by Microsoft of 8.10. Check the Firebase iOS SDK release notes to see what's changed, which includes various bug fixes as well as privacy manifest support.
[GoogleService-Info.plist|google-services.json]
file to your app project.[GoogleService-Info.plist|google-services.json]
build action behaviour to [Bundle Resource|GoogleServicesJson]
by Right clicking/Build Action.This plugin is a wrapper around the iOS/Android Firebase platform bindings. As such, it takes dependencies on the minimum versions of the Firebase iOS/Android SDKs that are required to support the features of the plugin.
Therefore, it is up to developers to manage the versions of the Firebase iOS/Android SDKs that are included in their projects. This is done by adding the appropriate AdamE.Firebase.iOS.*
and Xamarin.Firebase.*
NuGet packages to your project. This is not strictly required for the plugin to work, but it is recommended to ensure that you are using the latest versions of the Firebase SDKs.
When new major versions of the native SDKs are released, Plugin.Firebase may or may not be compatible with them. It depends on whether or not the major version bumb includes breaking API changes. In such cases, report an issue and the plugin will be updated to support the new version.
Note: It is recommended to use the same version number for all AdamE.Firebase.iOS.* packages (e.g. 11.6.0)
The new plugin version 1.2.0 now supports .NET MAUI applications with .NET 6 🚀
To get started add the GoogleService-Info.plist
and the google-services.json
files to the root folder of your project and include them in the .csproj file like this:
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<GoogleServicesJson Include="google-services.json" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<BundleResource Include="GoogleService-Info.plist" />
</ItemGroup>
Be sure to change the TargetFramework
condition to the correct value for your target versions (i.e. net6.0-*
, net7.0-*
, net8.0-*
, etc.)
Initialize the plugin in your MauiProgram.cs
like this:
using Plugin.Firebase.Auth;
#if IOS
using Plugin.Firebase.Core.Platforms.iOS;
#elif ANDROID
using Plugin.Firebase.Core.Platforms.Android;
#endif
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
return MauiApp
.CreateBuilder()
.UseMauiApp<App>()
...
.RegisterFirebaseServices()
.Build();
}
private static MauiAppBuilder RegisterFirebaseServices(this MauiAppBuilder builder)
{
builder.ConfigureLifecycleEvents(events => {
#if IOS
events.AddiOS(iOS => iOS.WillFinishLaunching((_,__) => {
CrossFirebase.Initialize();
return false;
}));
#elif ANDROID
events.AddAndroid(android => android.OnCreate((activity, _) =>
CrossFirebase.Initialize(activity)));
#endif
});
builder.Services.AddSingleton(_ => CrossFirebaseAuth.Current);
return builder;
}
}
Ensure the ApplicationId
in your .csproj
file matches the bundle_id
and package_name
inside of the [GoogleService-Info.plist|google-services.json]
files:
<ApplicationId>com.example.myapp</ApplicationId>
The plugin doesn't support Windows or Mac catalyst, so either remove their targets from your .csproj
file or use preprocessor directives and MSBuild conditions, e.g:
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios' OR '$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Plugin.Firebase" Version="1.2.0" />
</ItemGroup>
Plugin.Firebase 2.0.7
, Plugin.Firebase.Auth 2.0.5
, Plugin.Firebase.Firestore 2.0.5
, Plugin.Firebase.Functions 2.0.2
or Plugin.Firebase.Storage 2.0.2
add the following ItemGroup
to your .csproj
file to prevent build errors:<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk7" Version="1.7.10" ExcludeAssets="build;buildTransitive" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.7.10" ExcludeAssets="build;buildTransitive" />
</ItemGroup>
ItemGroup
to your .csproj
file to prevent build errors:<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.12.0.2" />
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.8.0.1" />
<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.6.0.2" />
</ItemGroup>
Plugin.Firebase.Firestore
add:<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.15.0.1" />
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.4.5.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.5.1" />
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.9.3.1" />
<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.8.0.7" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core" Version="2.8.7.1" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx" Version="2.8.7.1" />
</ItemGroup>
Take a look at the sample project to get more information.
If you are working with an older Xamarin project and are not able to migrate to .NET MAUI yet, there is a legacy version of the plugin called Plugin.Firebase.Legacy. The code for this package is located on a branch called legacy
. Bugfixes or other small important changes can be done here and will be synced to the development/master
branch if needed.
PackageReference
to the .csproj file
of your android project to prevent a build error (see this github comment for more information):<PackageReference Include="Xamarin.Google.Guava.ListenableFuture" Version="1.0.0.2" ExcludeAssets="build;buildTransitive" />
default Firebase App is not initialized
, adding one package explicitly seems to resolve this issue (it doesn't seem to matter which package gets added).In the docs folder you can find for every feature a designated readme file that describes the setup and usage of this feature or where to find more information.
In the sample folder you can find a sample Xamarin.Forms project. This project serves as a base to play around with the plugin and to test features that are hard to test automatically (like Authentication or Cloud Messages). playground-functions is a Cloud Functions project and contains the code to enable sending Cloud Messages from the backend.
In the tests folder you can find a Xamarin.Forms project that lets you run integration tests. You should definitely check out the *Fixture.cs
files to learn how the plugin is supposed to work. All the tests should pass when they get executed on a real device.
In case you would like to run the sample or test project by yourself, you need to add the GoogleService-Info.plist
and google-services.json
files of your own firebase project and adapt the other config files like Info.plist, Entitlements.plist, AndroidManifest.xml
.
@coop-tim has created a .NET 8 sample project with a really good and extensive description. It's targeting iOS and Android with Firebase Cloud Messaging, Analytics and the relevant build pipelines to get them built and pushed into App Center. Definitely worth checking it out!
If you would like to use the Firebase Local Emulator Suite for your tests or rapid prototyping you can do so by following the steps of the Getting started guide and calling the UseEmulator(host, port)
method of the desired firebase service before doing any other operations.
For example the Plugin.Firebase.IntegrationTests
project is configured to be able to use the Cloud Firestore emulator. You can start the emulator with initial seed data by running firebase emulators:start --only firestore --import=test-data/
. Uncomment the line CrossFirebaseFirestore.Current.UseEmulator("localhost", 8080);
in IntegrationTestAppDelegate.cs
or MainActivity.cs
to let the test project know it should use the emulator. Now all firestore related tests should pass.
Problems with the Xamarin.Firebase.iOS.Core package mean that installation can fail on Windows due to long paths See dotnet/maui#17828. To combat this, you need to enable long paths in the registry and move your local nuget cache. You should also keep the path to your project as short as possible.:
Run in an elevated prompt
New-ItemProperty `
-Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" `
-Value 1 `
-PropertyType DWORD `
-Force
Create a folder named C:\n
. Add an environment variable:
NUGET_PACKAGES = C:\n
Install package !!!manually via CLI!!!
Don't open or build the project in VS until you have done the next part.
Navigate to your project folder and run in a command line:
dotnet add package AdamE.Firebase.iOS.Core
You are welcome to contribute to this project by creating a Pull Request. The project contains an .editorconfig file that handles the code formatting, so please apply the formatting rules by running dotnet format src/Plugin.Firebase.sln
in the console before creating a Pull Request (see dotnet-format docs or this video for more information).
Plugin.Firebase
is released under the MIT license. See the LICENSE file for details.
DateTime
in Firestore #137Microsoft.CSharp
#143DidReceiveRegistrationToken
method to FirebaseCloudMessagingImplementation
FAQs
The plugin includes cross-platform APIs for Firebase Analytics, Auth, Cloud Messaging, Crashlytics, Dynamic Links, Firestore, Cloud Functions, Remote Config and Storage.
We found that plugin.firebase demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.