Skip to content

Instantly share code, notes, and snippets.

@bezysoftware
Last active January 3, 2017 13:47
Show Gist options
  • Select an option

  • Save bezysoftware/e0619ec963ae749bcee7a4e060ed86ea to your computer and use it in GitHub Desktop.

Select an option

Save bezysoftware/e0619ec963ae749bcee7a4e060ed86ea to your computer and use it in GitHub Desktop.
// authenticate user with facebook and use the access token
var token = "access_token_xyz";
// specify your app’s client key when creating the auth provider
var ap = new FirebaseAuthProvider(new FirebaseAuthConfig("<YOUR APP API KEY>"));
// sign in with OAuth. You can also sign in anonymously
var auth = ap.SignInWithOAuth(FirebaseAuthType.Facebook, token);
var firebase = new FirebaseClient(
"https://dinosaur-facts.firebaseio.com/",
new FirebaseOptions
{
AuthTokenAsyncFactory = () => auth.FirebaseToken
});
var dinos = await firebase
.Child(“dinosaurs”)
.OnceAsync<Dinosaur>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment