Track取消了facebook登录
Track canceled facebook login
我希望跟踪那些出现Facebook登录对话框的用户,并选择关闭它(通过点击"取消"或只是关闭弹出窗口)。
我正在使用Facebook SDK并调用FB.login()
从文档它是不清楚的,但它确实出现可能有一些方法来跟踪这一点,所以,如果有人在这里知道如何,或可以帮助,它将是感激的。谢谢!
完整代码:
var facebook = (function(){
// Configuration
var serverDomain = '365scores.com',
appID = '158698534219579';
// Load the SDK asynchronously
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
window.fbAsyncInit = function(){
FB.init({
appId : appID,
cookie : true, // enable cookies
xfbml : true, // parse social plugins on this page
version : 'v2.0' // use version 2.0
});
FB.getLoginStatus(FBLoginStatus);
FB.Event.subscribe('auth.authResponseChange', FBLoginStatus);
};
function FBLoginStatus(response){
// The response object is returned with a status field that lets the
// app know the current login status of the person.
// Full docs on the response object can be found in the documentation
// for FB.getLoginStatus().
if( response.status === 'connected' ){
// Logged into your app and Facebook.
//connected(response);
$(document).trigger('connection', ['facebook', response]);
}
else if( response.status === 'not_authorized' ){
// The person is logged into Facebook, but not your app.
}
else{
// The person is not logged into Facebook, so we're not sure if
// they are logged into this app or not.
}
};
function checkLoginState() {
FB.getLoginStatus(function(response) {
FBLoginStatus(response);
});
}
function connected(res){
console.log( res )
console.log('FACEBOOK CONENCTED');
/*
FB.api('/me', function(response){
});
*/
}
return FBLoginStatus;
})();
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
FB.api('/me', function(response) {
console.log('Good to see you, ' + response.name + '.');
});
} else {
console.log('User cancelled login or did not fully authorize.');
}
});
相关文章:
- 使用acess代币登录Facebook,并通过网络应用程序离线发布
- 如何检查用户已经登录facebook
- 通过Javascript SDK登录Facebook可以在移动设备和本地主机上使用,但不能在台式机上使用
- 允许通过Cordova上的Firebase登录Facebook
- 为移动网站高效登录Facebook
- 如何允许从iFrame登录facebook
- 如何使用jquery登录Facebook用户后检索数据
- Facebook JS SDK.我如何使用Facebook登录,而无需用户实际登录Facebook
- 在网络应用程序中登录Facebook
- 使用Sencha Touch 2在应用程序中登录Facebook
- Wierd文本:“#_=_”在成功登录Facebook后显示在URL上 春季社交
- 弹出窗口关闭并刷新成功登录Facebook的父页面
- 使用Firebase和Ionic登录Facebook后重定向视图
- 是否可以临时登录Facebook以共享链接
- 不使用javascript登录Facebook
- 使用Parse登录Facebook,但我得到--https://api.parse.com/1/users404--刷新
- Firebase authWithOAuthPopup登录Facebook发出警告
- 已登录Facebook,但未连接到我的应用程序
- Cordova:使用javascript api登录facebook不起作用
- 在原生ios6UIWebView中登录Facebook Javascript(在SAFARI上工作)