You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
createUserWithEmail does not work at all on andorid. #140
There is work on a new branch by @Salakar that will replace the current auth version work. Hopefully we'll have the new stuff merged in soon/this weekend.
importFirestackfrom'react-native-firestack';constfirestack=newFirestack({debug: true});firestack.auth().onAuthStateChanged(user=>{if(user){console.log(user)}else{console.log('Not signed in');}});firestack.auth().signInWithEmailAndPassword('email@example.com','A123456').catch(e=>{console.log(e)});console.log(firestack.auth().currentUser);
Verbose console output:
debugger-ui:83 Console was cleared
log.js:20firestack | [info] Creating new firestack instance
log.js:20firestack | [info] Calling configure with options Objectdebug: true__proto__: Object
log.js:20firestack:auth | [info] Creating onAuthStateChanged listener
log.js:20firestack:auth | [info] Signing in user with email and password email@example.com
firebase.js:17null
AppRegistry.js:97Running application "penalty" with appParams: {"initialProps":{},"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
firebase.js:7Objectauthenticated: falseeventName: "listenForAuth"__proto__: Object
YellowBox.js:69Debugger and device times have drifted by more than 60s. Please correct this by running adb shell "date `date +%m%d%H%M%Y.%S`" on your debugger machine.console.warn @ YellowBox.js:69emitTimeDriftWarning @ JSTimersExecution.js:230__callFunction @ MessageQueue.js:236(anonymous function) @ MessageQueue.js:108guard @ MessageQueue.js:46callFunctionReturnFlushedQueue @ MessageQueue.js:107onmessage @ debuggerWorker.js:44
log.js:20 firestack | [info] Native error occurred while calling configure Object {msg: "FirebaseApp name [DEFAULT] already exists!"}msg: "FirebaseApp name [DEFAULT] already exists!"__proto__: Object
firebase.js:7 Object {errorMessage: "No current user", errorCode: 100}
@thesabbir can you try the below, added comments - appears to be working here, not sure what part isn't working?
importFirestackfrom'react-native-firestack';constfirestack=Firestack.initializeApp({debug: '*',});firestack.auth().onAuthStateChanged(()=>{if(firestack.auth().currentUser){console.log(firestack.auth().currentUser.isAnonymous);}else{console.log('Not signed in');}});firestack.auth().signInWithEmailAndPassword('email@example.com','A123456').then((u)=>{console.warn(firestack.auth().currentUser.email);console.warn(firestack.auth().currentUser.uid);}).catch(e=>{console.log(e)});// this won't work - it's synchronous - so will be called before signInWithEmailAndPassword is finished// console.log(firestack.auth().currentUser);// you'd use this to check if already signed in, for example:// if (!firestack.auth().currentUser) { // do sign-in/register logic } else { // already signed in }
Activity
thesabbir commentedon Nov 17, 2016
#63 might be on android too.
auser commentedon Nov 17, 2016
There is work on a new branch by @Salakar that will replace the current auth version work. Hopefully we'll have the new stuff merged in soon/this weekend.
Salakar commentedon Nov 17, 2016
@thesabbir feel free to give my branch a go - just remember it's now in line with the firebase web api, so your code above becomes:
firestack.auth().createUserWithEmailAndPassword(email, password).then().catch()And you can get the current user the same way as the web api:
thesabbir commentedon Nov 17, 2016
No luck.
Installation:
My Code:
Verbose console output:
works fine on iOS though :(
Salakar commentedon Nov 17, 2016
@thesabbir can you try the below, added comments - appears to be working here, not sure what part isn't working?
thesabbir commentedon Nov 17, 2016
console.log(firestack.auth().currentUser);was only there to see initial value.I tried running your code.
Good news is it works fine on my 6.0.1 device.
But doesn't work on 6.0.0 genymotion, which is odd 😕
Salakar commentedon Nov 17, 2016
I assume genymotion doesn't have play services? Firebase needs google play services integration to work
tegument commentedon Nov 17, 2016
yes you need to install google play services on genymotion virtual device:
https://github.com/codepath/android_guides/wiki/Genymotion-2.0-Emulators-with-Google-Play-support
Salakar commentedon Nov 19, 2016
Closing as fixed on v3 branch. Side note, I'm adding in a play services check into the android code, should at least warn now if no play services.