Hey Guys
Just had a quick query regarding Firebase Auth implementation within Xamarin, I am actually using Xamarin Forms but within this I am calling natively to Xamarin.Android to allow me access to the Xamarin.Firebase Auth and Common Android Binding Librarires(will do the same for the Ios librarires)
I am using the latest versions of everything to get a prototype up and running to enable me to verify against my backend using the JWT token from Firebase itself after Email/Federated/custom sign in, My question is the method at which I am doing works effectively but it doesn’t feel completely right,
Taking facebook for example I have followed a few versions online, I call the facebook sdk with my app id, my Firebase App is initialized then using the sign in with credential I call firebase with my facebook AccessToken after Facebook Login, this all seems to work fine and OnComplete if the task was successful a mAuth.CurrentUser is updated, this all seems to work fine and I get my sign in the weird part I think seems to be when I have the current user I want to extract some information, so user.Email, user.Uid, user.Name etc but when I call GetToken(false) it starts a Task which is fine so I call .Result on this and get a GetTokenResult from here though there is no simple way to access token , I can see it when I add a breakpoint after and expand the element I can see base and Token but no access method for the token
To get around these I used System.Reflection property info GetValue using “Token” and receiv my token from here allowing me to continue on by
System.Reflection.PropertyInfo pinfo = typeof(Tokenresult).GetProperty("Token");
Var token = (string)pinfo.GetValu(TokenResult,null)
To me this doesn’t seem as easy as it should be so I feel like I am doing something wrong or not quite right anyway, I am aware there is a GetTokenAsync method but it seems to break my code or deadlock it no matter what extra options I try.
Id really just love some advice or different methods other people have used who are maybe more experienced than I am myself or if there is a simpler way within Xamarin.Forms, Android or Ios to implement Firebase Authentication
Thanks for any help!