Facebook Login with Vue.js

ios
android

#1

Has anyone had success in integrating any of the Facebook login methods with a Vue.js implementations? I started down the path of nativescript-facebook https://github.com/NativeScript/nativescript-facebook but it’s for angular and I’m struggling to get it to work and tried others as well.


#2

Most of the plugins are not specific to a particular flavour, neither facebook plugin is not limited. May I know what is the issue you are facing here?


#3

So I followed a bunch of plugins and eventually landed with https://github.com/alexpalchikovskiy/nativescript-facebook-vue-example. This is working now.

<template>
  <Page class="page">
    <ActionBar class="action-bar" title="Home"/>

    <StackLayout>
      <Button @tap="login()" text="Log in (custom)"></Button>
    </StackLayout>

  </Page>
</template>

<script>
  import * as Facebook from "nativescript-facebook";

  export default {
    methods: {
      login:function() {
        Facebook.login((err, fbData) => { });
      }
    },
    created: function() {
      Facebook.init('1234456678'); // Use your facebook app code
    },
  }
</script>