1

I implement an app which need to get list invitable_friends from Facebook. I had researched how to get invitable_friends (have some question like that on stack overflow but I also cannot get any right way to fix it) and also tried but the result always null, I guess the reason is that :The invitable_friends list is only available for games with a Canvas implementation. But I don't know how to integrate Canvas or do somethings else to get the list invitable_friends(sorry, maybe it's a naive way to make a question but I'm not have any experience at this). please let me know the way to get this list(configuration my app on Facebook developer page or do anything). Here is my code to get list after login success:

[FBRequestConnection startWithGraphPath:@"/me/invitable_friends"
                                          parameters:nil
                                          HTTPMethod:@"GET"
                                   completionHandler:^(
                                                       FBRequestConnection *connection,
                                                       NSDictionary *result,
                                                       NSError *error
                                                       ) {
                                       /* handle the result */
                                       NSLog(@"resurl");
                                   }];

2 Answers2

5

The Invitable Friends API is only available to apps classified as Games, which also have a Canvas presence. This API is not available in v1.0. It may be called by mobile games as long as they also have a Canvas presence.

Source: https://developers.facebook.com/docs/graph-api/reference/v2.2/user/invitable_friends

Meaning, it is ONLY possible for games, if your App is NOT a game you can forget about it. And you MUST have a Canvas implementation next to your mobile one. Meaning, you can´t just create a Canvas App that redirects (which would not be allowed), you would have to create a game that actually runs on Canvas too.

Detailed information about Canvas Apps can be found in the docs: https://developers.facebook.com/docs/games/canvas

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • Sorry,I don't understand what you mean with sentence:`you would have to create a game that actually runs on Canvas too` what do you mean with the app runs on Canvas? –  Nov 21 '14 at 11:30
  • check out the last link in my answer about canvas apps – andyrandy Nov 21 '14 at 12:03
  • so, have any other way more easy to get friend list which not install my app? –  Nov 22 '14 at 03:54
  • no, there are no other ways, you are not supposed to get all friends if they did not install your app – andyrandy Nov 22 '14 at 11:05
  • if I can config the App on Facebook page as Game app then use it into my app to get `invitable_friends`(my iOS App still not a game app but use ID and name of Facebook app which config for game)? –  Nov 24 '14 at 07:06
  • first of all: don´t do that if it´s not a game. also, you got an iOS app, invitable_friends is for games on canvas only. – andyrandy Nov 24 '14 at 08:09
  • Thanks for your recommend, but please let me know the reason?I also wan to know, is it possible or not?if possible how to do it? –  Nov 24 '14 at 08:22
  • 1
    because invitable_friends is for app requests only, and app requests are actually "game requests". it is possible with a canvas implementation though, i´ve explained it in my answer. – andyrandy Nov 24 '14 at 08:36
3

After many research I found the solution. Into the Basic Setting field of Facebook Developer page I need to add platform Website:Site URL:https://local.host:3000/ and Facebook Canvas:Secure Canvas URL:https://local.host:3000/. Of course this site is add for dummy app. When you want to public the app will need submit your app for review by Facebook, then you will need a real website. You can see the answer of @Spundun Here. With those config, now I can get friends list by invitable-friends

Community
  • 1
  • 1