이미 페이스 북에 로그인했지만 자신의 계정에서 내 앱을 삭제 한 사용자가있는 경우 사용자가 이미 내 앱을 다시 입력했을 때만 publish_stream을 묻는 방법 로그인?Facebook + 게시 스트림 만 묻기
감사합니다.
FB.getLoginStatus(function (response) {
if (response.status === 'connected') {
// the user is logged in and has authenticated your
// app, and response.authResponse supplies
// the user's ID, a valid access token, a signed
// request, and the time the access token
// and signed request each expire
uid = response.authResponse.userID;
accesstoken = response.authResponse.accessToken;
SrReferral = '@ViewBag.Referral';
window.fbuserid = uid;
var postData = { facebookUID: uid, facebookAccessTok: accesstoken, facebookSrReferral: SrReferral };
$.ajax({
url: '@Url.Action("DisplayGolfers")',
type: 'POST',
data: postData,
dataType: 'html',
success: function (responseText) {
$("#container").html(responseText);
}
});
} else if (response.status === 'not_authorized') {
// the user is logged in to Facebook,
// but has not authenticated your app
} else {
// the user isn't logged in to Facebook.
window.FB.login(function (response) {
if (response.authResponse) {
uid = response.authResponse.userID;
accesstoken = response.authResponse.accessToken;
SrReferral = '@ViewBag.Referral';
window.fbuserid = uid;
var postData = { facebookUID: uid, facebookAccessTok: accesstoken, facebookSrReferral: SrReferral };
$.ajax({
url: '@Url.Action("DisplayGolfers")',
type: 'POST',
data: postData,
dataType: 'html',
success: function (responseText) {
$("#container").html(responseText);
}
});
} else {
console.log('User cancelled login or did not fully authorize.');
alert('User cancelled login');
}
}, { scope: 'publish_stream' });
};
});
}
감사의 섹션, 내가 http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus의 설명서를 읽고 있었다 "페이스 북의 서버로 왕복"를 참조하십시오/상태 중 하나는 사용자가 FB에 로그온했지만 아직 내 사용자가 로그온하는 시나리오 중 하나 인 것으로 생각되는 내 앱을 인증하는 것입니다. 내 앱은 본인의 앱이지만 계정 설정에서 바로 제거 할 수 있습니다. '다른 경우 if (response.status ==='not_authorized ')'. 사용자가 내 앱을 제거 할 때 왜 로그인해서는 안되는 지 잘 모르겠습니다. 내가 틀렸다면 나를 바로 잡아주세요. 감사. – k80sg
@ user415795 글쎄, 일단 사용자가 응용 프로그램을 제거하면 그는 여전히 기술적으로 로그인되어 있지만 더 이상 응용 프로그램 사용자가 아님을 알게되면 로그 아웃 (또는 되돌릴 가능성이 있습니다)해야합니다 . 'FB.getLoginStatus'를 두 번째 매개 변수가'true '와 동일하게 사용하면 Facebook에서 새로운 상태를 가져오고 사용자가 앱에 로그인되어 있지 않다는 사실을 알게됩니다. 두번째 매개 변수없이'FB.getLoginStatus'를 호출하면 사용자와의 연결 상태를 나타내지 않는'authResponse' 캐시됩니다. –