amitgoel1287 / angular2-facebook Goto Github PK
View Code? Open in Web Editor NEWCode how to integrate facebook login in angular2 framework .
Home Page: http://patterbuzz.com
Code how to integrate facebook login in angular2 framework .
Home Page: http://patterbuzz.com
Shows Following Error
FB.login() called before FB.init().
Line No:
sdk.js:39
Hi, I followed your approach but getting below error:
Failed to load resource: net::ERR_NAME_RESOLUTION_FAILED
https://www.facebook.com/connect/ping?client_id={my-app-id}&domain=localhost&origin=1&redirect_uri=http%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2FP5DLcu0KGJB.js%3Fversion%3D42%23cb%3Dfed5cec4%26domain%3Dlocalhost%26origin%3Dhttp%253A%252F%252Flocalhost%253A3000%252Fff1a152fc%26relation%3Dparent&response_type=token%2Csigned_request%2Ccode&sdk=joey
My code looks like this:
FB.init({
appId : '{my-app-id}',
cookie : false, // enable cookies to allow the server to access
// the session
xfbml : true, // parse social plugins on this page
version : 'v2.5' // use graph api version 2.5
});
Can you include a sample of your app.module.ts?
Every thing is good. token is generated but in that token email is not available.
Hello,
When clicking the button, i am getting a blank popup and the popup does not close. No errors in the popup.
I am using Angular 5.0.4, Angular Material rc3.
Here is the code
apiVersion is set to 'v2.5' and have tested with 'v2.8' which is my FB apps' version
import { Component, OnInit } from '@angular/core';
import { socialProviders } from "../social-login";
declare const FB:any;
@Component({
selector: 'app-connexion',
templateUrl: './connexion.component.html',
styleUrls: ['./connexion.component.scss']
})
export class ConnexionComponent implements OnInit {
constructor() {
FB.init({
appId : socialProviders.facebook.clientId,
cookie : false, // enable cookies to allow the server to access
xfbml : true,
version : socialProviders.facebook.apiVersion
});
FB.getLoginStatus((response) => {
this.statusChangeCallback(response);
});
}
ngOnInit() {
}
statusChangeCallback(resp) {
if (resp.status === 'connected') {
// connect here with your server for facebook login by passing access token given by facebook
console.log(resp);
}
else if (resp.status === 'not_authorized') {
}
else {
}
}
connexionFb() {
FB.login();
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.