Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Facebook request me/friends.
Started by noeguer Jun 19 2014 12:25 AM

- - - - -
10 replies to this topic
empty facebook request friends
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

noeguer

[GLOBAL: userInfoPane.html]
noeguer
  • Contributor

  • 265 posts
  • Corona SDK

I have another account (friend) autorized the app in that account. It appears in graph facebook stadistic so the app is installed ok. Me and the other account. But facebook request me/ friends always give me an empty table.
I know it only give friends using the app. But I have one and is not showing me.
The app is not in development mode.
Any ideas? Have someone had this problem?
Any solution?

The code i am using is the example in doc. But #data is always 0

[TOPIC: post.html]
#2

Gooner87

[GLOBAL: userInfoPane.html]
Gooner87
  • Contributor

  • 161 posts
  • Corona SDK

request me/friends should return a table of your full facebook friends list

 

I use facebook.request("me/friends", "GET", {fields = "installed"}) to just pull out results of friends with the app installed, it has been a long  time since I implemented that code, so I don't know what changes might have happened since.

 

Hope it helps



[TOPIC: post.html]
#3

dgaedcke

[GLOBAL: userInfoPane.html]
dgaedcke
  • Contributor

  • 264 posts
  • Corona SDK

Facebook has changed the rules

me/friends only returns users with the app installed

 

If you either user a developer account, or get advanced permission from facebook, you can now get the full friend list with this call.

facebook.request( "me/invitable_friends?offset=1&limit=600", "GET", {} )

 

Other rules:

your app has to be a game

it has to have a fbCanvas pressence

both http and https canvas URL's must be filled out in the Facebook portal

 

I'm using a "test" version (in Facebook terms) of my app....not sure if that is helping me or not but I finally have this working....



[TOPIC: post.html]
#4

BearHugGames

[GLOBAL: userInfoPane.html]
BearHugGames
  • Enthusiast

  • 33 posts
  • Enterprise

I'm having the exact same problem.

 

1. I have 2 people playing the game (one is myself, one is my friend on fb, we are both friends with each other).

2. These people are tracked in developers.facebook.com in their stats.

3. We have even sent each other requests via facebook.showDialog( "apprequests", { message="You should download this game!" } ) and these requests show up in my facebook on iPhone

 

However - facebook.request("me/friends?fields=installed") returns an empty set of data every time.

 

I have also tried facebook.request("me/friends") and a few other varieties and get nothing back.

 

I can't however do the 'invitable_friends' work around because my game is iOS only and not a FB canvas app.

 

Anyone have any ideas? Very stuck and a bit frustrated. Been looking at this for days now.



[TOPIC: post.html]
#5

dgaedcke

[GLOBAL: userInfoPane.html]
dgaedcke
  • Contributor

  • 264 posts
  • Corona SDK

Sorry bro....Facebook rules suck.....so does that whole company.....all you can do is what I'm having to do....build a canvas app to go with the mobile version



[TOPIC: post.html]
#6

BearHugGames

[GLOBAL: userInfoPane.html]
BearHugGames
  • Enthusiast

  • 33 posts
  • Enterprise

Actually I think I just found my issue (typically 2 minutes after posting here haha) - I wasn't calling this from the corona sdk...

 

facebook.publishInstall( "XXXXXXXX" )

 

where XXXXXXX is your FB App ID.

 

Basically I wasn't telling facebook that the app was installed.

 

Give that a try mate, you might not have to worry about the canvas app just yet.



[TOPIC: post.html]
#7

BearHugGames

[GLOBAL: userInfoPane.html]
BearHugGames
  • Enthusiast

  • 33 posts
  • Enterprise

Nope tell a lie, that's a red herring I think.

 

"While not part of the Graph API, Published Installs is a way for apps to participate in Facebook's mobile ad campaign which can report (to Facebook) that the app has been installed. This process is simple and there is no callback information and no need to call facebook.login()"

 

http://docs.coronalabs.com/daily/guide/social/implementFacebook/index.html

 

 

hmmm, I shall continue...



[TOPIC: post.html]
#8

BearHugGames

[GLOBAL: userInfoPane.html]
BearHugGames
  • Enthusiast

  • 33 posts
  • Enterprise

I have posted a bug on Facebook about it.  You can subscribe to that bug to keep track of it here.

 

https://developers.facebook.com/bugs/744871615562329/

 

We'll see what they say. Still no joy.  "me/friends" returns empty data, but for the test users I set up it works fine.

 

It's as if it's not registering the 'installed' flag when the app is run / signed into.



[TOPIC: post.html]
#9

BearHugGames

[GLOBAL: userInfoPane.html]
BearHugGames
  • Enthusiast

  • 33 posts
  • Enterprise

FIXED! OMG! THE RELIEF! hahaha

 

It turns out that there's a combination of permission changes...

 

So I had to change my initial login from

 

facebook.login( FB_AppId, fbconnectlistener )

 

to

 

facebook.login( FB_AppId, fbconnectlistener, {"user_friends"} )

 

 

It's also a TWO WAY agreement, so you have to accept the user_friends permission and so does your friend in order for him to appear in your list it seems.

 

Whew! So relieved :D



[TOPIC: post.html]
#10

dgaedcke

[GLOBAL: userInfoPane.html]
dgaedcke
  • Contributor

  • 264 posts
  • Corona SDK

Are you seeing "successful" results in "dev" mode?? 

 

If so, I'd be cautious about claiming victory yet.

I'm skeptical because I've read the Facebook TOS carefully and everything I've read (not just Corona forums) says CLEARLY that Facebook only now allows app that are games AND have a canvas presence to get the friend-list.

 

And if a users friends don't have your app yet, they cannot possibly have "agreed" in advance, and so nothing will be in the list for initial users....

 

I look forward to more comments from you as you learn more as this is a very important are of functionality for me as well.

 

Thanks for sharing what you've learned.

Dewey



[TOPIC: post.html]
#11

BearHugGames

[GLOBAL: userInfoPane.html]
BearHugGames
  • Enthusiast

  • 33 posts
  • Enterprise

Hey Dewey,

 

I might be after slightly different functionality than you, but just to clarify I am only after a list of friends who have the app installed (so their avatars show up on the map).

 

The "user_friends" permission is really "users of the app who are friends with you".

 

As for getting the entire list of friends (whether they have installed or not) yes I remember them saying about that.  I've opted for a FB style pop up friends list instead using this function...

 

facebook.showDialog( "apprequests", { message="You should download this game!" } )

 

When you say "dev" mode - are you referring to the FB App on developers.facebook.com being in "dev" mode (ie not published)?  My FB app is published and all seems to be working.

 

Who knows how long for :)




[topic_controls]
[/topic_controls]