Skip to content
An asynchronous .Net client library for Firebase
C# HTML Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.nuget Add NuGet.exe Feb 13, 2015
FireSharp.Core
FireSharp.Serialization.JsonNet.Core Changing nuspec files (#114) May 24, 2018
FireSharp.Serialization.ServiceStack.Core Changing nuspec files (#114) May 24, 2018
FireSharp.Test.Console.Core Upgrated for Net Standard 2.0 (#113) May 24, 2018
FireSharp.Tests.Core
Samples Remove ConfigureAwait(false) Mar 15, 2015
misc update logo Aug 21, 2015
.gitattributes Initial commit Nov 13, 2013
.gitignore
FireSharp.Core.sln Upgrated for Net Standard 2.0 (#113) May 24, 2018
README.md Update README.md (#123) Aug 5, 2018
UNLICENSE Update and rename LICENSE.md to UNLICENSE Jul 13, 2018
UpgradeLog.htm
appveyor.yml Upgrated for Net Standard 2.0 (#113) May 24, 2018
build.sh Add circlCI files and delete src folder Jan 19, 2015
circle.yml Add circlCI files and delete src folder Jan 19, 2015

README.md

Fire#

Firebase REST API wrapper for the .NET & Xamarin.

Changes are sent to all subscribed clients automatically, so you can update your clients in realtime from the backend.

AppVeyor Build status Coverage Status Stories in Ready

IMPORTANT : v1 docs moved here.

Installation (NuGet)

//**Install v2**
Install-Package FireSharp

//**Install v1**
Install-Package FireSharp -Version 1.1.0

Usage

FirebaseClient uses Newtonsoft.Json by default.

How can I configure FireSharp?


  IFirebaseConfig config = new FirebaseConfig
  {
     AuthSecret = "your_firebase_secret",
     BasePath = "https://yourfirebase.firebaseio.com/"
  };
IFirebaseClient  client = new FirebaseClient(config);

So far, supported methods are :

Set

var todo = new Todo {
                name = "Execute SET",
                priority = 2
            };
SetResponse response = await _client.SetAsync("todos/set", todo);
Todo result = response.ResultAs<Todo>(); //The response will contain the data written

Push

 var todo = new Todo {
                name = "Execute PUSH",
                priority = 2
            };
PushResponse response =await  _client.PushAsync("todos/push", todo);
response.Result.name //The result will contain the child name of the new data that was added

Get

 FirebaseResponse response = await _client.GetAsync("todos/set");
 Todo todo=response.ResultAs<Todo>(); //The response will contain the data being retreived

Update

var todo = new Todo {
                name = "Execute UPDATE!",
                priority = 1
            };

FirebaseResponse response =await  _client.UpdateAsync("todos/set", todo);
Todo todo = response.ResultAs<Todo>(); //The response will contain the data written

Delete

FirebaseResponse response =await  _client.DeleteAsync("todos"); //Deletes todos collection
Console.WriteLine(response.StatusCode);

Listen Streaming from the REST API

EventStreamResponse response = await _client.OnAsync("chat", (sender, args, context) => {
       System.Console.WriteLine(args.Data);
});

//Call dispose to stop listening for events
response.Dispose();

Release Notes

2.1

  • Firesharp now is a Net Standard library, so it's available for every platform.

2.0

  • Use Microsoft HTTP Client Libraries instead of RestSharp
  • FireSharp is now Portable Library
  • Supports Streaming from the REST API (Firebase REST endpoints support the EventSource / Server-Sent Events protocol.)
  • It is fully asynchronous and designed to be non-blocking

More information about Firebase and the Firebase API is available at the official website.

You can’t perform that action at this time.