我想使用Facebook Api獲取Facebook好友列表。因此,我在Facebook上創建了新應用,並獲得了AppID,並在我的原生iOS應用中使用該AppID和Bundle ID時提供Bundle ID,並使用api獲取所有朋友列表以獲取空朋友列表。使用我的FacebookAppID在iOS中無法使用
如果我使用"SendRequestHowTo"示例項目的應用程序ID,它將獲得登錄用戶的所有朋友列表。告訴我如何在Facebook開發人員站點上配置我的新應用程序以獲取好友列表。
我對獲得好友列表代碼:
// Query to fetch the active user's friends, limit to 25.
NSString *query =
@"SELECT uid, name, pic_square FROM user WHERE uid IN "
@"(SELECT uid2 FROM friend WHERE uid1 = me())";
// Set up the query parameter
NSDictionary *queryParam = @{ @"q": query };
// Make the API request that uses FQL
[FBRequestConnection startWithGraphPath:@"/fql"
parameters:queryParam
HTTPMethod:@"GET"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (error) {
NSLog(@"Error: %@", [error localizedDescription]);
} else {
_friends_list = (NSArray *) result[@"data"];
NSLog(@"Result: %@", result);
[self getLetsWalkeeFriendList];
// Sort Table Data
[self sortTableView];
// [_tbl_view_friends reloadData];
}
[self.view setUserInteractionEnabled:YES];
// [self.view hideToastActivity];
}];
使用示例項目的AppID(即FacebookAppID:403223126407920和捆綁IDENTIFER:com.facebook.samples.SendRequestsHowTo)。當我與Facebook登錄我輸出
Result: {
data = (
{
name = "Assad Sarwar";
"pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpa1/t1.0-1/c153.5.545.545/s50x50/1978738_766566543368250_230425531_n.jpg";
uid = 100000447351759;
},
{
name = "Muhammad Hassan Butt";
"pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xap1/t1.0-1/c0.0.50.50/p50x50/10167970_873047696055100_7845811348955741805_n.jpg";
uid = 100000496339789;
},
{
name = "Umair Jafar";
"pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xfp1/t1.0-1/c0.2.50.50/p50x50/10500337_910092152350902_4827832642500691993_n.jpg";
uid = 100000503784242;
}, .........
)
}
,當我用我的AppID這是由Facebook和使用相同的用戶進行登錄到Facebook的規定,我得到了像
Result: {
data = ()
}
去developer.facebook.com – NullData