daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void setupFirebaseAuth(){
  2.         Log.d(TAG, "setupFirebaseAuth: setting up firebase auth");
  3.         mAuth = FirebaseAuth.getInstance();
  4.         onStart();
  5.  
  6.         mFirebaseDatabase = FirebaseDatabase.getInstance();
  7.         myRef = mFirebaseDatabase.getReference();
  8.  
  9.         FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
  10.         if(user != null) {
  11.             // user is signed in
  12.             Log.d(TAG, "onAuthStateChanged: sign_in: " + user.getUid());
  13.  
  14.             myRef.addListenerForSingleValueEvent(new ValueEventListener() {
  15.                 @Override
  16.                 public void onDataChange(DataSnapshot dataSnapshot) {
  17.                     //1st check: Make sure the username is  not already in use
  18.  
  19.                     //add new user to the database
  20.  
  21.                     //add new user_account_setting to the database
  22.                 }
  23.  
  24.                 @Override
  25.                 public void onCancelled(DatabaseError databaseError) {
  26.  
  27.                 }
  28.             });
  29.  
  30.         } else {
  31.             Log.d(TAG, "setupFirebaseAuth: signed_out");
  32.         }
  33.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top