Assuing你已經了Facebook的API連接和啓動和運行。 將FaceBook api連接命名爲變量FB。這是你如何檢查。
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
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
} 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.
}
});
所以是的,這是一個JS調用,目前FB不支持getLoginStatus爲C#API實現,但是您可以隨時返回一個異步結果到服務器呼叫與JS響應,並在那裏工作的方式。
我需要在頁面上:無論你想這樣
現在使用這個擴展方法檢查我沒有調用任何Facebook API,所以這不適用於我的場景 – user1186050