OnFire
Quick lIbrary for Firebase Email Auth and Database
Install / Use
/learn @sps014/OnFireREADME
OnFire
Quick,Tiny ,Dirty library for Firebase Email Auth and Database Usage . Helps in quick prototyping.
OnFire
| List | type | decriptions |
| :--------: | :-: | :-: |
| Database | class | add ,insert, delete data in realtime on firebase data |
| EMailAuth | class | signup,login,verify,reset password for users |
| Cache | class | used to cache firebase data on device ram |
| RestClient | class | A Rest Http Client with get ,put ,delete etc |
Example Usage
Read From Realtime DataBase
Database dbref = new Database("xyz.firebaseio.com");
var userName=dbref.Child("Scores").Child("highestScore").GetValue<string>();
Console.WriteLine($"user Name : {userName}");
Save in Database
int Score = 9099;
Database dbref = new Database("xyz.firebaseio.com");
dbref.Child("Scores").Child("highestScore").SaveValue(Score);
Delete from Database
Database dbref = new Database("xyz.firebaseio.com");
dbref.Child("Scores").Child("highestScore").DeleteValue();
Database Data Change Events
Database dbref = new Database("xyz.firebaseio.com");
var child = dbref.Child("Scores").Child("highestScore");
child.SubscribeDataChange<int>();
//called every time data is changed in database
child.OnDataChange += Program_OnDataChange;
/// when no need to get notified just Unsubscribe
child.UnsubscribeDataChange();
Authenticated Database Operation
Database dbref = new Database("xyz.firebaseio.com");
dbref.AccessToken = AccessToken;
dbref.Child("Scores").Child("highestScore").SaveValue(UserDetail);
Sign in User
//Get Auth Key from your project on Firebase
EMailAuth auth = new EMailAuth(AuthKey);
EMailAuth.User user=await auth.SignInUser(email, pass);
var IDToken=user.IdToken;
var userInfo =await auth.GetUser(IDToken);
Console.WriteLine(userInfo.EmailVerified);
Sign up User
//Get Auth Key from your project on Firebase
EMailAuth auth = new EMailAuth(AuthKey);
EMailAuth.User user=await auth.SignUpUser(email, pass);
var IDToken=user.IdToken;
var userInfo =await auth.GetUser(IDToken);
Console.WriteLine(userInfo.CreatedAt);
Verify Email
EMailAuth auth = new EMailAuth(AuthKey);
auth.SendVerification(idToken);
Related Skills
feishu-drive
343.3k|
things-mac
343.3kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
343.3kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
postkit
PostgreSQL-native identity, configuration, metering, and job queues. SQL functions that work with any language or driver
