デスクトップで C# を使用して、1 人のユーザーが電子メールまたは名前で人を検索するアプリを開発しようとしています。次に、ユーザーの情報と公開アルバムまたは写真を使用してユーザーを一覧表示します。次に、プログラムのユーザーは、適切な検索者が友人を追加するのを見つけることができれば、写真に目を向けます。
私の問題は、公開アルバムをリストして表示できないことです。FQL とグラフ API で試しましたが、どちらも null データを返しました。私がこれのために書いたコード:
ArrayList pictureLink;
public void userPhotos(string userID)
{
var fb2 = new FacebookClient(_accessToken);
//result1 and result2 aren't using in code only for looking for with breakpoint
dynamic result1 = fb2.Get("fql", new { q = "SELECT aid,cover_pid FROM album WHERE owner=" + kisiID });
dynamic result2 = fb2.Get("fql", new { q = "SELECT pid,aid FROM photo WHERE owner=" + kisiID });
ArrayList imageSize; //for gettig highest pixell of picture
pictureLink = new ArrayList();
var fb = new FacebookClient(_accessToken);
//dynamic albums = fb.Get("me/albums"); // THİS code is rigth runnig
dynamic albums = fb.Get(userID + "/albums");
foreach (dynamic albumInfo in albums.data)
{
//Get the Pictures inside the album this gives JASON objects list that has photo attributes
// described here http://developers.facebook.com/docs/reference/api/photo/
dynamic albumsPhotos = fb.Get(albumInfo.id + "/photos");
foreach (dynamic rs in albumsPhotos.data)
{
imageSize= new ArrayList();
foreach (dynamic rsa in rs.images)
{
imageSize.Add(rsa.height);
}
int highestImage = Convert.ToInt32(imageSize[0]);
foreach (dynamic rsa in rs.images)
{
if (rsa.height == highestImage )
{
string link= rsa.source;
pictureLink.Add(link);
}
}
}
}
}