firebase-authentication

FirebaseAuth.AuthStateListener not called in Fragment class

我的未来我决定 提交于 2019-12-24 07:58:03
问题 My navigation drawer contained in MainActivity navigates to several Fragments. In the onCreate method of these Fragment classes, am trying to onAuthStateChanged to get the current user: FirebaseAuth.AuthStateListener mAuthListener; ... public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mAuthListener = new FirebaseAuth.AuthStateListener() { @Override public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { user = firebaseAuth.getCurrentUser(); if

Firebase : How to read every child node in parent except children with particular data

房东的猫 提交于 2019-12-24 07:25:11
问题 Assume the following. posts : { "$postid":{ "meta":{ "state":true, "text" :"I should be read", }, "likes":{ "uid1":true, "uid2":true, }, }, "$postid":{ "meta":{ "state":false, "text" :"I should be read", }, "likes":{ "uid1":true, "uid2":true, "uid3":true, }, } } I want to query the parent node('posts') as follows. Leave out posts with state = false Prioritise posts with most likes Security Rules Deny posts with state == false to be read. Here's the Javascript Version Of how I'm querying data.

Firebase GAS webapp Google popup disappears

强颜欢笑 提交于 2019-12-24 07:03:18
问题 I am trying to upgrade my firebase GAS webapp, and previously I had a popup which would log the user in with Google. I'm not sure what I'm doing wrong, but I have upgraded to the new firebase, and am now trying to get the same login working with the new code format. What is happening, is that the popup comes up and immediately disappears. Can anyone see what I am doing wrong here? Thanks for you help. <html lang="en"> <head> <script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-app

Firebase GAS webapp Google popup disappears

喜欢而已 提交于 2019-12-24 07:02:43
问题 I am trying to upgrade my firebase GAS webapp, and previously I had a popup which would log the user in with Google. I'm not sure what I'm doing wrong, but I have upgraded to the new firebase, and am now trying to get the same login working with the new code format. What is happening, is that the popup comes up and immediately disappears. Can anyone see what I am doing wrong here? Thanks for you help. <html lang="en"> <head> <script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-app

How to check whether a user is authenticated or not in Firebase?

邮差的信 提交于 2019-12-24 06:42:53
问题 I have a few sign-up methods in my app as shown below: Let's revolve the problem around Google sign-in method : What I am doing is that when a user signs in enteringDataIntoUserNode() method is called inside signInWithCredential() method like: private void firebaseAuthWithGoogle(GoogleSignInAccount acct) { AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null); // signing in mAuth.signInWithCredential(credential) .addOnCompleteListener(this, new

How to fix TypeError when using signInWithCredential on node.js? [EDIT: bug in Firebase 6.2.2]

主宰稳场 提交于 2019-12-24 06:35:53
问题 I am trying to sign in to firebase using a Google Id Token, as I'm developing an app that will be running on a raspberry pi, but when trying to sign in using the received token firebase crashes when using signInWithCredential. Here's my minimal reproducible example var firebase = require("firebase/app"); require("firebase/auth"); const firebaseConfig = { ... }; // Initialize Firebase firebase.initializeApp(firebaseConfig); const id_token = "A_GOOGLE_ID_TOKEN"; var credential = firebase.auth

Anonymous user in Firebase

不打扰是莪最后的温柔 提交于 2019-12-24 06:15:10
问题 I'm running a crowdsourcing website with Amazon Mechanical Turk. Firebase is used to track intermediate information of users. Since AMT authentication is not related to Firebase, I can't use those to authenticate user. And to be able to write data to Firebase, the authentication must be present. My current solution is using anonymous users. While it works, I found that every time the page is reloaded, a new anonymous user is created. This might not be scalable, as during development I have

Anonymous user in Firebase

纵饮孤独 提交于 2019-12-24 06:15:03
问题 I'm running a crowdsourcing website with Amazon Mechanical Turk. Firebase is used to track intermediate information of users. Since AMT authentication is not related to Firebase, I can't use those to authenticate user. And to be able to write data to Firebase, the authentication must be present. My current solution is using anonymous users. While it works, I found that every time the page is reloaded, a new anonymous user is created. This might not be scalable, as during development I have

How to updateProfile for phoneNumber for an email/password account in firebase with react

≯℡__Kan透↙ 提交于 2019-12-24 06:07:48
问题 I am getting to the success block as everything goes well, but then when I check the user it seems as if the user never got updated. I have this working for displayName, but for some reason phoneNumber is not working. Here is the code: const user = firebase.auth().currentUser; user .updateProfile({ phoneNumber: '01112223333' }) .then(() => { alert('success'); console.log(user); }) .catch(err => { alert(err); }); 回答1: You should use updatePhoneNumber method of User. 来源: https://stackoverflow

Unable to fetch user's gmail email address through Firebase

寵の児 提交于 2019-12-24 06:03:26
问题 I'm developing an app which use Firebase` as a BaaS. I have integrated Google Sign-in and I want to fetch user's name, email address and profile pic. I have successfully fetched the name and profile pic, but I'm unable to fetch the email address. Here's Google API client setup: /* Setup the Google API object to allow Google+ logins */ mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Plus.API) .addScope(Plus.SCOPE