【发布时间】:2014-08-14 20:50:58
【问题描述】:
我想从我的应用程序中获取 facebook 好友列表,但返回数据:[]... 为空! :(
场景是这样的:
C#
const string QueryToGetFbInfo = "me";
const string QueryToGetFbPhoto = "me?fields=picture.width(200).height(200)";
const string QueryToGetFriendList = "me/friends?fields=name,picture.width(100).height(100)";
private void btnFacebook_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
FacebookSessionClient fbSession = new FacebookSessionClient("FB_APP_ID");
fbSession.LoginWithApp("public_profile, user_friends, read_friendlists, email", "custom_state_string");
}
private async void tbnShowfriends_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
FacebookSession session = SessionStorage.Load();
FacebookClient client = new FacebookClient(session.AccessToken);
// Get Facebook FriendList
dynamic friends = await client.GetTaskAsync(QueryToGetFriendList);
//Get Facebook user info
dynamic result = await client.GetTaskAsync(QueryToGetFbInfo);
GraphUser user = new GraphUser(result);
//Get profile picture from facebook
dynamic result1 = await client.GetTaskAsync(QueryToGetFbPhoto);
JsonObject json = result1.picture.data;
var picture = (IDictionary<string, object>)json;
....
}
Facebook App Config 有权限...忘记了一些?..新面板让我有点困惑,也许我忘记了应用程序设置中的某些内容...
当我选择 Api Graph 时,返回给我一个好友列表,很好!
但是当我选择我的应用程序时,我没有返回任何内容
我忘记了什么?...我该如何解决这个问题?
【问题讨论】:
-
任何使用 v2.0 的最终解决方案?
标签: facebook facebook-graph-api windows-phone-8 facebook-c#-sdk