0

I have a Nativescript App built with Angular and I use the Nativescript Plugin Firebase: https://github.com/EddyVerbruggen/nativescript-plugin-firebase.

When I authenticate with Facebook, it retrieves me the user data successfully, but the user does not appear as logged in, and the onAuthStateChanged() listener is not triggered.

The function I use is the simplest one:

  public async signInWithFacebookPopup(): Promise<any> {
    return await firebase.login({
      type: firebase.LoginType.FACEBOOK
    }).then(
      function (result) {
          return result;
        },
        function (errorMessage) {
          return {error: errorMessage};
        }
    );
  }

So here the "result" I get is the actual user data.

Shouldn't the method onAuthStateChanged() be triggered? Also, after logging in and getting the user's data, If I call firebaseWeb.auth().currentUser, I get undefined.

[UPDATE]

When the Facebook window is displayed (before introducing my credentials), I get this error in the console:

chromium: [INFO:library_loader_hooks.cc(51)] Chromium logging enabled: level = 0, default verbosity = 0
chromium: [ERROR:filesystem_posix.cc(89)] stat /data/user/0/[APP_NAME]/cache/WebView/Crashpad: No such file or directory (2)
chromium: [ERROR:filesystem_posix.cc(62)] mkdir /data/user/0/[APP_NAME]/cache/WebView/Crashpad: No such file or directory (2)

Could it be that this one breaks some other behaviours later?

Diego
  • 709
  • 7
  • 18
  • Where you are adding `onAuthStateChanged` listener? – Manoj Oct 28 '19 at 08:24
  • It's called from a service method, I add it in the ngOnInit of the main app.component. It works if I log in with email and password with Nativescript, and for the Web with any authentication, but it does not trigger with Facebook login in Nativescript – Diego Oct 28 '19 at 17:33
  • Did you ever figure this out? I currently can't seem to get the authState to change for either email or Facebook authentication. – iamcootis Jan 15 '20 at 02:12
  • No, for now I stopped the Nativescript app, although this was the only blocker that I had but it was a very important one. I had to do some workarounds for the firebase plugin in other parts too and I decided to not carry on and maybe consider other possibilities than Nativescript (for other reasons too) – Diego Jan 16 '20 at 06:17

0 Answers0