Zhen
Zhen

Reputation: 12431

How to trigger facebook Dialog with a list of friends

Is there a way to trigger a facebook dialog with list of friends in the iPhone client?

enter image description here

Upvotes: 0

Views: 853

Answers (3)

Nadav
Nadav

Reputation: 394

You can use FBWebDialogs which is part of FacebookSDK.

For Example, if the session is already active, try this:

[FBWebDialogs presentRequestsDialogModallyWithSession:nil message:@"Message" title:nil parameters:nil handler:nil];

Upvotes: 0

user1055568
user1055568

Reputation: 1429

The answer from the iOS Tutorial works fine for me, except it does not show friends to choose from. If I type a letter, then it shows me friends whose name starts with that, but I cannot figure out how to see the entire friends list to choose from, as the question asked.

Upvotes: 0

Juicy Scripter
Juicy Scripter

Reputation: 25918

You can do this as shown in iOS Tutorial (Step 7: Integrating with Social Channels)

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                           @"Come check out my app.",  @"message",
                           nil];

[facebook dialog:@"apprequests"
              andParams:params
            andDelegate:self];

Update:
If you want those requests will be visible to users on Facebook (not just in your application), than you need to provide Site URL or Canvas URL in application settings (this will be the URL user redirected on request accept). Otherwise those requests will only be accessible by API, so you'll be able to get 'em within application and show to users.

Upvotes: 2

Related Questions