Closed AppWerft closed 6 years ago
But the error is from TitaniumFirebaseAuthModule
. So where in your code do you use TitaniumFirebaseAuthModule.onStart
? It looks like this is initialized before win.open()
This is a very good thought. I will inspect. I have used the original TitaniumFirebaseAuthModule. My new code comes from a submodule. The question is, when the onStart
will fired?
I guess:
onAppCreate: if app is started onStart: if the JS layer calls require
The app needs to be configured in the open
event of the root window.
I guess the root window will build in app.js as first window. This I did in app.js:
var $ = Ti.UI.createWindow();
$.addEventListener('open',function() {
FirebaseCore.configure();
FirebaseAuth.createUserWithEmail({
email:"rainer@com",
password:"********",
callback : function(e) {
FirebaseAuth.signInWithEmail({
email:"rainer@com",
password:"********",
callback : function(e) {
console.log(e);
}
});
}
});
});
I found in manual: FirebaseApp.initializeApp() return an instance of FirebaseApp.
In next module firebase.auth
. in onStart() event in line 76(?) this will call mAuth = FirebaseAuth.getInstance();
. If I call a Kroll.method like createUserWithEmail()
mAuth
is null.
I found: FirebaseCore.configure();
must run before window is opened. So the first (splash) activity will taken.
This simple code above generates: