Plugin.Firebase.Firestore 3.1.1

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

// Install Plugin.Firebase.Firestore as a Cake Tool
#tool nuget:?package=Plugin.Firebase.Firestore&version=3.1.1                

Firestore

Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud. Like Firebase Realtime Database, it keeps your data in sync across client apps through realtime listeners and offers offline support for mobile and web so you can build responsive apps that work regardless of network latency or Internet connectivity. Cloud Firestore also offers seamless integration with other Firebase and Google Cloud products, including Cloud Functions.

Installation

Nuget

NuGet

Install-Package Plugin.Firebase.Firestore

Setup

Usage

To be able to fetch your data from the firestore, you'll need to create a POCO that implements the IFirestoreObject interface. Use the FirestoreDocumentId and FirestoreProperty attributes to hook up its properties, for example:


public sealed class Pokemon : IFirestoreObject
{
    [FirestoreDocumentId]
    public string Id { get; private set; }

    [FirestoreProperty("name")]
    public string Name { get; private set; }

    [FirestoreProperty("weight_in_kg")]
    public double WeightInKg { get; private set; }

    [FirestoreProperty("height_in_cm")]
    public float HeightInCm { get; private set; }

    [FirestoreProperty("sighting_count")]
    public long SightingCount { get; private set; }

    [FirestoreProperty("is_from_first_generation")]
    public bool IsFromFirstGeneration { get; private set; }

    [FirestoreProperty("poke_type")]
    public PokeType PokeType { get; private set; }

    [FirestoreProperty("moves")]
    public IList<string> Moves { get; private set; }
    
    [FirestoreProperty("first_sighting_location")]
    public SightingLocation FirstSightingLocation { get; private set; }

    [FirestoreProperty("items")]
    public IList<SimpleItem> Items { get; private set; }

    [FirestoreProperty("creation_date")]
    public DateTimeOffset CreationDate { get; private set; }

    [FirestoreServerTimestamp("server_timestamp")]
    public DateTimeOffset ServerTimestamp { get; private set; }

    [FirestoreProperty("original_reference")]
    public IDocumentReference OriginalReference { get; private set; }

}

This class is represented in firestore like this:

firestore_poco.png

Further information

Take a look at the documentation for the AdamE.Firebase.iOS.CloudFirestore packages, because Plugin.Firebase's code is abstracted but still very similar.

Since code should be documenting itself you can also take a look at the following classes:

Release notes

  • Version 3.1.1
    • ToNSObject and ToJavaObject handle null inputs (PR #352)
    • Fixing IWriteBatch.UpdateData issue where .NET objects were not being converted to NSObjects (PR #351)
  • Version 3.1.0
    • Update to .net8
  • Version 3.0.0
    • Swapped Xamarin.Firebase.iOS.Firestore (native SDK 8.10.0) for AdamE.Firebase.iOS.Firestore (native SDK 10.24.0)
  • Version 2.0.7
    • Fixed missing DateTime in firestore (PR #280)
    • Fix simple number arrays on firestore android (issue #276)
  • Version 2.0.6
    • Support int properties on IFirestoreObjects on Android (PR #247)
    • Firestore plugin converts NSNumbers to nullable .NET types (e.g. float?, int?, long?) (PR #250)
  • Version 2.0.5
    • Bumped up Xamarin.Firebase.Firestore package to version 124.8.1.1
  • Version 2.0.4
    • Firestore CollectionReference inherits Query (PR #205)
    • Adding GetCollectionGroup to FirebaseFirestore (PR #207)
    • Adding synchronous versions of WriteBatch.Commit() (PR #208)
    • Added the Parent property to CollectionReference. (PR #209)
  • Version 2.0.3
    • Use Debug.WriteLine() in object extensions (issue #174)
  • Version 2.0.2
    • re-add tohashmap extension for firestore setdataasync method when data is a dictionary of objects
    • fix firestore setdataasync for ios
  • Version 2.0.1
    • Remove unnecessary UseMaui property from csproj files
    • Readd net6.0 tfm
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-android34.0 is compatible.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-ios18.0 is compatible.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
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 Plugin.Firebase.Firestore:

Package Downloads
Plugin.Firebase

The plugin includes cross-platform APIs for Firebase Analytics, Auth, Cloud Messaging, Crashlytics, Dynamic Links, Firestore, Cloud Functions, Remote Config and Storage.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.1.1 1,445 12/3/2024
3.1.0 3,331 11/9/2024
3.0.0 25,317 5/29/2024
2.0.7 32,463 3/29/2024
2.0.6 17,544 1/13/2024
2.0.5 11,367 11/14/2023
2.0.4 6,771 10/18/2023
2.0.3 16,982 7/20/2023
2.0.2 21,302 4/11/2023
2.0.1 1,995 3/31/2023
2.0.0 5,226 3/26/2023