0.0.2 • Published 5 years ago

facebook-login-service v0.0.2

Weekly downloads
3
License
-
Repository
-
Last release
5 years ago

Instruction for using Facebbok Login service

step-1 install the library using following command

   npm install facebook-login-service

import the file containg environment variables in app.module.ts, and add it to the providers list providers: [

... ,

{ provide: "environment", useValue: environment }

] ./src/environments/environment.ts

export const environment = { production: false, clientID: { facebook: "Facebook_APP_ID", },

};

Facebook_APP_ID: Fill the ID by Regestring your project on facebook for developers


step-2 import our service in the components


import { FacebookLoginServiceService } from 'facebook-login-service'

create service instance with constructor

constructor( private FacebookLoginServiceService: FacebookLoginServiceService ) {}

Create some function like signIn and in this we call facebook login function. ********Example:****************** signIn() { this.FacebookLoginServiceService.signInWithFacebook().then(data => { this.userData = data; }); }

signout() { if (this.FacebookLoginServiceService.signout()) { this.userData = ""; } else { } }