2010-12-20 92 views

回答

2

使用getLoginStatus函數。它返回的對象的屬性之一是「權限」,即權限列表。 http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus

+0

謝謝,但如何才能做到這一點編程方式使用C#?對不起,我應該更加精確。 – 2010-12-21 23:51:55

+1

對我來說,這似乎已不再可能。我只獲得'狀態'和'authResponse',但裏面沒有燙髮。也許它已被刪除? – 2012-01-20 16:45:55

+0

authResponse對象包含您需要的內容。包含一個用戶ID和accessToken。 – 2012-01-21 00:52:21

0

最簡單的答案(雖然我需要一些工作來掌握它)似乎是這個SDK。

http://facebooksdk.codeplex.com/

使用它。

因爲我沒有指定我想要一個C#解決方案,Bret Baisley的答案被證明是非常有用的,我認爲他的答案是正確的。

0

我發現這個PHP解決方案非常方便:

if (array_key_exists('publish_stream', $permissions['data'][0])) { 
    // Permission is granted! 
    // Do the related task 
    $post_id = $facebook->api('/me/feed', 'post', array('message'=>'Hello World!')); 
} else { 
    // We don't have the permission 
    // Alert the user or ask for the permission! 
    header("Location: ".$facebook->getLoginUrl(array("scope" => "publish_stream"))); 
} 

把它從這裏,也與FBQL版本: http://www.masteringapi.com/tutorials/how-to-check-if-user-has-certian-permission-facebook-api/22/

相關問題