Plugin.Firebase.Firestore
3.0.0
See the version list below for details.
dotnet add package Plugin.Firebase.Firestore --version 3.0.0
NuGet\Install-Package Plugin.Firebase.Firestore -Version 3.0.0
<PackageReference Include="Plugin.Firebase.Firestore" Version="3.0.0" />
paket add Plugin.Firebase.Firestore --version 3.0.0
#r "nuget: Plugin.Firebase.Firestore, 3.0.0"
// Install Plugin.Firebase.Firestore as a Cake Addin #addin nuget:?package=Plugin.Firebase.Firestore&version=3.0.0 // Install Plugin.Firebase.Firestore as a Cake Tool #tool nuget:?package=Plugin.Firebase.Firestore&version=3.0.0
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
Install-Package Plugin.Firebase.Firestore
Setup
- Follow the instructions for the basic setup
- Enable Cloud Firestore at your project in the Firebase Console
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:
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:
- src/.../IFirebaseFirestore.cs
- src/.../ICollectionReference.cs
- src/.../IDocumentReference.cs
- src/.../IQuery.cs
- src/.../ITransaction.cs
- src/.../IWriteBatch.cs
- tests/.../FirestoreFixture.cs
Release notes
- 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)
- Use
- 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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-android31.0 is compatible. net6.0-ios was computed. net6.0-ios16.1 is compatible. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Plugin.Firebase.Core (>= 3.0.0)
-
net6.0-android31.0
- Plugin.Firebase.Core (>= 3.0.0)
- Xamarin.Firebase.Firestore (>= 124.8.1.1)
-
net6.0-ios16.1
- AdamE.Firebase.iOS.CloudFirestore (>= 10.24.0)
- Plugin.Firebase.Core (>= 3.0.0)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
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.