quave:facebook-native-login

v1.0.0Published 4 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

meteor-facebook-native-login

This package use cordova-plugin-facebook4 to login using native Facebook Sdk.

Documentation of the Cordova plugin here.

Installation

meteor add quave:facebook-native-login

Usage

This package add a new function Meteor.loginWithNativeFacebook(options, callback);, the params are the same of Meteor.loginWithFacebook. If you call under a not Cordova environment it with will call Meteor.loginWithFacebook(options, callback);.

Add this to mobile-config.js:

App.configurePlugin('cordova-plugin-facebook4', {
  APP_ID: 'app_id',
  APP_NAME: 'my.app.name'
});

Using facebookConnectPlugin

This package export facebookConnectPlugin, if you are not running in Cordova it will export a object with the same API as the Cordova plugin object, but if you try to use any function of the object it will throw an error ie:

import { facebookConnectPlugin } from "meteor/jsep:facebook-native-login"

// if Meteor.isCordova it will calle the orignal facebookConnectPlugin of cordova-plugin-facebook4,
// otherwise it will thrown an error
facebookConnectPlugin.login()