Mithun
Mithun

Reputation: 479

FQL for getting online friends list- Objective c

I am creating an iPhone app using Facebook api. I have created the app and now I'm getting friends name, uid, sex and profile picture.I have followed the steps in the https://developers.facebook.com And I need to get the online friends list from my account. I think I need to get get permission first. How can do that? please help

Thanks

Upvotes: 0

Views: 629

Answers (2)

Brian Ray
Brian Ray

Reputation: 1276

You'll need to prompt your users to grant the user_online_presence and/or friends_online_presence permissions.

Then you can get the user's friends' online statuses by querying for the user.online_presence field via an FQL Call.

Upvotes: 2

Zigglzworth
Zigglzworth

Reputation: 6813

Find out what permissions you need and use the api to ask for the user to grant them (this example asks for the publish_stream permission):

//This is an array filled with permissions you need
NSArray* permissions =  [[NSArray arrayWithObjects:@"publish_stream", nil] retain]; 
facebook = [[Facebook alloc] initWithAppId:@"yourappid" andDelegate:self];


if (![facebook isSessionValid]) {
    NSLog(@"Sending facebook connect request");
    [facebook authorize:permissions]; 
}
else {
    NSLog(@"There is already an active FB session");
}

Upvotes: 1

Related Questions