I was trying to see if there weren't any issues with this plugin and the last version of nativescript (3.4) and angular (5.0.0)...
When I try to subscribe to the event
onAuthStateChaged
from the init method or by calling the listener, nothing is triggered. Nothing is passed to the callback function.
_Update_
I've investigated a bit more and I found out that the error happens when I initialize firebase, in fact the initialization is never completed but no error is caught by the promise.
When I also try to use other functions, it give me the message that I must run the initialization first.
Facing the same issue
On 29 Dec 2017 2:00 a.m., "giorgiopiatti" notifications@github.com wrote:
I was trying to see if there weren't any issues with this plugin and the
last version of nativescript (3.4) and angular (5.0.0)...All seems to work but when I try to subscribe to the event
onAuthStateChaged
from the init method or by calling the listener, nothing is triggered.
Nothing is passed to the callback function.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/588,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE2PtoJRfKgK8HbwaIH68zijTEJ9_o8gks5tE_pbgaJpZM4ROoKw
.
If anyone can share a simple project reproducing this issue then I'm glad to take a look. In the meanwhile, please compare your code to the Angular demo app in this repo which seems to work fine.
@EddyVerbruggen I've used the demo app code, forking directly from this repository and updating to Angular 5.1.0 as showed there https://github.com/giorgiopiatti/nativescript-plugin-firebase/tree/master/demo-ng
Thanks ;)
Also having this issue
Are you implying with Angular 5.0.0 it was working fine?
I believe I was having a similar problem. After firebase.init I was able to login, but the onAuthStateChange Listener was not firing. Putting firebase.init inside a 1 second timeout made it operational. This happened on angular 5, and maybe 4 too.
Thankyou @NicholasSmilovic Wrapping firebase.init inside a 1-second timeout resolved the issue.
setTimeout(()=>{
firebase.init(()=>{...})
},1000)
@EddyVerbruggen No also with Angular 5.0.0, wasn't working but with the suggestion of Nicholas also is solved.
See #613.