rlamasb / firebase.xamarin Goto Github PK
View Code? Open in Web Editor NEWLight weight wrapper for Firebase Realtime Database REST API.
License: MIT License
Light weight wrapper for Firebase Realtime Database REST API.
License: MIT License
Hey good day i am using simple rule in firebase {
"rules": {
".read":"auth != null",
".write":"auth != null"
}
}
my Login using FirebaseAuth
auth.SignInWithEmailAndPassword(email, password)
.AddOnCompleteListener(this, this);
Get Token Using
var mToken = FirebaseInstanceId.Instance.Token;
var firebase = new FirebaseClient(PageFirebaseSettings.FirebaseDbUrl);
var account = new Accounts
{
uid = PageRandomKeys.AlphaNumericKeys(),
email = email,
homecity = homeCity
};
var item = await firebase
.Child(PageTables.TableAccountProfile)
.WithAuth(mToken)
.PostAsync(account);
but i receive UnhandledException which part did i miss? Thanks a lot
is there a way to send an email verification?
Please take a look on your package while installing i am facing these errors because of latest android API level has no support of your package. Please release a latest version of your package that compatible with latest API levels.
Error NU1202 Package Firebase.Xamarin 0.3.6 is not compatible with monoandroid81 (MonoAndroid,Version=v8.1). Package Firebase.Xamarin 0.3.6 supports: net (.NETFramework,Version=v0.0)
Hi,
I'm having issues when trying to login with the google oauth authenication.
I'm getting a HttpRequestException: 400 (Bad Request)
Could you maybe tell me exactly where to find the firebase API key? Maybe I'm using the wrong one.
The accesstoken is the token that I got from the google login using the Xamarin.auth package so I think I'm ok on that front.
To provide you with some more context I'm using this code in the PCL project of my solution. I'm also using mvvmcross for this.
My Code:
var authProvider = new FirebaseAuthProvider(new FirebaseConfig("My token from firebase console"));
var auth = await authProvider.SignInWithOAuthAsync(FirebaseAuthType.Google, accessToken);
In the source code it is stated that "this is used mainly for following filtering queries and due to firebase implementation the data may actually not be ordered." Does that mean there is no way to sort the data?
error I get: Severity Code Description Project File Line Suppression State
Error NU1202 Package Firebase.Xamarin 0.3.6 is not compatible with monoandroid81 (MonoAndroid, Version = v8.1). Package Firebase.Xamarin 0.3.6 supports: net (.NET Framework, Version = v0.0)
hi. im current fiddling with putasync vs postasync and have some issues with it.
it seems like...
postAsync() > adding a new obj into firebase and return a obj
putAsync() > add/update obj and return void.
can I check how do I know if a new data is inserted/updated using putAsync()?
-data inserted new can return a obj like postAsync()?
-return some kind of value is show if data is inserted or updated?
updates: on a side note, i cant seem to be able to find OrderByKey() in the xamarin studio's 'intellisense'. any idea how to implement it?
Hi
I m new in xamarin.forms and new in firebase also , how can I get only one data with parameters , I mean something like
select users from mydb where users.name ="erman" and users.active =1
Thanks for developing this nuget package .
I'm trying to write with user authentication, as with the rules of the default server. auth! = null ...
using the basic method you propose, I have the error BAD 400 ...
can you help me?
var item = await firebase
.Child("yourentity")
.WithAuth(auth.FirebaseToken)
.PostAsync(new YourObject());
When I login with SignInWithEmailAndPasswordAsync() I get a Bad Request exception.
I have the same issue with CreateUserWithEmailAndPasswordAsync(), where I don´t know if the email is registered previously, only get a Bad Request.
Thanks.
I tried to enable Offline database for get data when network connection is not available.
Is it possible with this framework?
Not? Any solution for this?
Thanks
set-up-lab has implemented a dotNET library for firebase storage i was hoping u can add it to this xamarin adaptation... or guide me through the process ... i would gladly hire you to do that if you are busy
I' use Xamarin.Forms and I just want to query. but I keep seeing this error that 'An unhandled exception occured.'
Do not you use this plugin on Xamarin.Forms?
async private void Load_Clicked(object sender, EventArgs e)
{
await LoadData();
}
public class FirebaseMemo
{
public string Memo { get; set; }
}
private async Task LoadData()
{
var firebase = new FirebaseClient("https://xamarinproject-176e8.firebaseio.com/");
var items = await firebase
.Child("Memovalue")
.OnceAsync<FirebaseMemo>();
foreach (var item in items)
{
FirebaseMemo Acc = new FirebaseMemo();
Acc.Memo = item.Object.Memo;
TextLabel.Text = Acc.Memo;
}
}
When you map a subscription to an ObservableCollection of POCO objects, they don't have a property for the "key". How would you get the relevant key to perform an update back in firebase?
var changedTodo = observableCollection.First();
changedTodo.Completed = true;
changedTodo.Description = "Modified Text Here";
var key = ????
todosRealTimeDb.Put(key, changedTodo);
Is there way to set http request timeout for auth provider and firebase clien? Default timeout is too long for my app.
Hi all,
I need to fire an event when the Database end update, how can i do this?
Hi,
I've been scratching my head for the past several hours with regards to observing/subscribing to a child/key. I see the changes via the Firebase DB, but on the client, I've noticed a delay of upwards to 40 seconds when listening for changes, which doesn't seem very real time to me.
I'm not sure if it's this library or RX.Net that's causing the delay.
Here's what I got; pretty standard:
_currentUserObserver = firebase
.Child(Keys.Users)
.WithAuth(authToken)
.AsObservable<Dictionary<string, object>>()
.Where(f => !string.IsNullOrEmpty(f.Key))
.Where(f => f.Key == CurrentUser.Key)
.Subscribe(d => Debug.WriteLine("Observing"));
I've played around with some of the RX.Net LINQ statements, such as .Sample(TimeSpan.FromSeconds(1)) or .Throttle(timeSpan), but no luck. Reference: http://stackoverflow.com/questions/3211134/how-to-throttle-event-stream-using-rx
Any thoughts?
Is there a way to update an existing record through this library?
Hey there,
I was just testing the API and I experienced that after a successful authentication:
When I set the database rule on firebase to:
.write == null
It obviously works without using the auth token, but thats a bit risky.. :)
Do you have any idea, why doesn't this work when I'm trying to use Post? :)
Thanks!
I want to OrderByChild but when I try it I got an exception of Bad Request
var fEvents = await client.Child("events").OrderBy("DateMilliseconds").OnceAsync();
when I use OrderByKey it works perfectly
Hi
I am extremely sorry that I have to create new issue but I don't have option to ask.
Can you please suggest me How I can use Authentication module of Firebase.Xamarine.Auth.
I have created project in firebase I have database and database rules over there.
Does an app require additional components or code to receive notifications?
I installed this package from nuget and don't understand how the app will receive push notifications.
How do i prevent firebase from providing a key when saving into the database since i have my own generator for keys?
Anyone known hoy to check if user log in.
Step 1, create user.
Step 2, login user. Then close the app
Step 3, check if user had log in..
Is there any documentation on how to use the Offline Database with this library?
Also, the .WithAuth(...)
documentation seems to be incorrect, as this method cannot be chained from .Child('...')
.
Will updates to the documentation be made to clarify these issues?
Thanks!
Have any version that are compatible with netstandard2.0?
Hi,
Is Firebase Storage supported?
Thanks,
Other functions work well but not realtime streaming. I tested in ios 11, xamarin forms
I cannot figure out how to get realtime data. I can get one at a time, but there is no notification saying that the data is finished updating. Can anyone show me how to do it so that I'll know when all the data has come in? Or can it give me a collection of items instead of one at a time?
FirebaseAuthProvider.CreateUserWithEmailAndPasswordAsync throws an Exception that is null and this, contains no message about the exception.
However, the acccount is indeed created.
i am able to authenticated with fb, google auth, but not able to use fcm authentication i.e by just entering id & password
please help
Hello,
I am trying at the moment to send a notification to a specific iphone device.
I succeed sending the notification in broadcast using group id (unique identifier for app).
I am now trying to send a notification to a specific device using FCM token.
I tried getting the token using this code:
public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) { var DeviceToken = deviceToken.Description; }
but it looks like it's not the token needed.
Here is the place where the token is asked:
https://ibb.co/ejr66o
How can I get the good token?
Thank you.
How I use the offline database control? is able to you include some readme about that?
I did the code bellow to include a Class Account:
try{
var item = await firebase.Child("users").PostAsync(user);
list_users.Add(user);
await LoadAdpterList();
}catch(Exception e){
list_users.Add(user);
await LoadNovo();
}
I made the following test:
include an user with internet(ok)
disabled internet
include an user without internet
- include on my listview (ok)
enable internet(ok)
but the user that was includeded on list didn't sync again. Even if I include another user. How i do it?
I need to authenticate the phones of users. Is this possible with this plugin?
I tried the firebase phone authentication for web and it's working fine so I tough of using it in a web view until I saw this promising plugin.
Hi
I use version 0.3.6 from nuget.
If I try to login
FirebaseAuthProvider authProvider = new FirebaseAuthProvider(new FirebaseConfig("MyAPIKeyHere"));
FirebaseAuthLink user = await authProvider.SignInWithEmailAndPasswordAsync("email", "password");
it the sign in never returns.
No error message, debugger waits and waits and waits
I try to login my users with email and password, I do this for get my user and it's works for now:
options = new FirebaseOptions.Builder()
.SetStorageBucket(".appspot.com")
.SetApplicationId("")
.SetApiKey("")
.SetDatabaseUrl("https://.firebaseio.com")
.SetGcmSenderId("")
.Build();
app = FirebaseApp.InitializeApp(Android.App.Application.Context, options);
authProvider = new FirebaseAuthProvider(new FirebaseConfig(options.ApiKey));
firebaseAuth = await authProvider.SignInWithEmailAndPasswordAsync(e, p);
name.Text = firebaseAuth.User.DisplayName;
But, how I persist this user for get the name or other infos in other page?
And the mostly important, how I can close my app and verify if my user is logged when I open again?
I using Xamarin.Forms in Cross Platform
PS. I hide the options infos.
Does this work on xamarin forms?
There are some cases, like register with an email that is already registered and signing in with a wrong password, that the library only return a HTTPRequestException with the message of "BAD Request 400". I've checked FirebaseAuthentication.net and it seems like they have a FirebaseAuthenticationException that will provide more information for easier debugging, but it seems like it's not exposed in Firebase.Xamarin. I'm developing on Xamarin and I can't install FA.net to it, so I can't know for sure. Are there plans to expose the exception or to implement equivalent facilities in Firebase.Xamarin?
Hi. I'm using Facebook and Twitter for login into my app. Facebook works fine. But when I'm trying to login with Twitter I always have '400: Bad request'.
My code is:
_authData = await _authProvider.SignInWithOAuthAsync(FirebaseAuthType.Twitter, token);
In this code 'token' is string that I got from Fabric Twitter SDK, it looks like: "token=,secret=".
Could you please help me find what's the problem, what am I doing wrong?
Hi, I can see that it this is based on https://github.com/step-up-labs/firebase-database-dotnet, but step-up-labs has another repo for Auth (https://github.com/step-up-labs/firebase-database-dotnet), wondering has this been implemented Firebase.Xamarin in any way?
I've browsed the code but just want to make sure I haven't simply overlooked it. Let me know if it has not been added and I'll get started on a fork to integrate it in.
I have a problem with the observer subscription of my firebase database. I subscribe my Listview to the realtime database of firebase with the following lines of code. I request the firebaseclient to give me an observer of the database, which I then ask to listen to any changes made in the database. If there are changes do the following.
Observer = firebase.Child("users").AsObservable<Account>();
List<Account> accountsFromDB = new List<Account>();
Observer.Subscribe(next =>
{
accountsFromDB.Add(account.Object);
},
error => { Debug.WriteLine("error"); },
onCompleted =>
{
adapter.setData(accountsFromDB);
adapter.NotifyDataSetChanged();
}
);
So when a change happens in the database the "next" will fetch every item in the database and add to the list, this works fine. After everything is collected from the database the "error" or "onCompleted" action should be called but aren't. Can someone help me understand this issue?
I have implemented what you did in the RealtimeStreaming example, but the function is never invoked. Why is that? Is this the method used to listen to changes in the database?
Does anyone have a basic Xamarin sample (e.g. todo list) that does Realtime and Offline? I'm struggling to get all the objects working together correctly.
Is this project redundant to this one? Their API seems almost identical.
The code sample that uses
.withAuth
doesn't work with the library when installed via nuget.
Congratulations for the work.
I am not able to save the application on RealTimeData
I used the example of Saving data and does not save the bank.
You can help me?
sorry, it was a rookie mistake 👍
i am able to get a token, but I am getting a generic 400 error with the following code:
var authProvider =
new FirebaseAuthProvider(new FirebaseConfig("--My API Key--"));
var auth = await authProvider.SignInWithEmailAndPasswordAsync(username, password);
var firebase = new FirebaseClient("https://mydbname.firebaseio.com/");
var user = new LocalUser();
var xx = await firebase.Child("Users").Child(username).WithAuth(auth.FirebaseToken).PostAsync(user,false).ConfigureAwait(true);
and the LocalUser is defined as:
public class LocalUser
{
public string SomeData = "MoarData";
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.