Search code examples
angularnativescript

Nativescript firebase plugin facebook authentication - Sign app in debug mode


I have successfully integrated Nativescript firebase plugin to enable facebook authentication. My FB login call looks like this:

firebase.login({
    type: firebase.LoginType.FACEBOOK,
    // Optional
    facebookOptions: {
      // defaults to ['public_profile', 'email']
      scope: ['public_profile', 'email']
    }
  }).then(
      function (result) {
        JSON.stringify(result);
      },
      function (errorMessage) {
        console.log(errorMessage);
      }
  );

Login fails with error "Error while trying to login with Fb SERVER_ERROR: [code] 1349195 [message]: The key hash does not match any stored key hashes" which is evident because I haven't added Keyhash in Facebook app.

I was expecting a key hash value in the error message according to the documentation so that I can add it in Facebook app.

I think the error message would have key hash only when the app is signed

Issue

  • I have already spent hours without any luck figuring out how to sign the app in debug mode. I am running the app using the command 'tns debug android'
  • I know it is possible to sign the app using 'tns run android' but it won't let me debug the app.

I think I am missing something tiny here - Any help would be appreciated.


Solution

  • Finally, I solved it using this. It turned out that it is important to keep extracted SSL folder in C drive.