[英]Facebook API integration in android .. to get my friendlist “ me/friends ” i want to get all data with name and user details
My code is
if (!facebook.isSessionValid()) {
facebook.authorize(this,
new String[]{"email","read_stream","read_custom_friendlists"},
new Facebook.DialogListener() {
public void onCancel() {
// Function to handle cancel event
}
public void onComplete(Bundle values) {
try {
getProfileInfo();
mAsyncRunner.request("me/friends ", new FriendsRequestListener());
/* Bundle params = new Bundle();
params.putString("fields", "name, picture");
new FriendsRequestListener();*/
}
catch (Exception e)
{
System.out.println(e);
//Log.d("Error in fetching frnd list",String.valueOf(e));
}
//getProfileInfo();
// Function to handle complete event
// Edit Preferences and update facebook acess_token
}
請簽出我的代碼,我也嘗試了圖形API資源管理器,但仍然在同一結果上不知道為什么..! 它返回{
“數據”:[],“摘要”:{
“總數”:446
}}
首先,您嘗試使用的權限僅使您可以訪問“朋友列表”,而不能訪問“朋友”。 確保您了解差異:
read_custom_friendlists-是read_friendlists登錄權限的新名稱。 這是為了闡明該權限授予訪問某個人的自定義朋友列表的權限,而不是該人的朋友的完整列表。
對於/me/friends
您將需要user_friends
權限,但是您也只會獲得與user_friends
一起授權您的應用程序的朋友。 有關更多信息,請參見無數Stackoverflow線程,例如: 使用Facebook Graph API獲取所有用戶朋友-Android
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.