Closed SailingSteve closed 7 years ago
@DaleMcGrew @jainanisha90 Question 1: Is there a chance that we developed with Facebook API 1.x, then upgraded to 2.1, and as a result we can now only see friends in our app, that have already added the WeVote app to their Facebook accounts? Question 2: When you debug the python server at line 664 in import_export_facebook/models, do you get a list of all of your facebook friends or just those who have signed up for WeVote? (I get an empty list, just like in the API Explorer) https://developers.facebook.com/tools/explorer/?method=GET&path=1184925174944744%2Ffriends&version=v2.10
Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app
https://stackoverflow.com/questions/23417356
In v2.0 of the Graph API, calling /me/friends returns the person's friends who also use the app.
In addition, in v2.0, you must request the user_friends permission from each user. user_friends is no longer included by default in every login. Each user must grant the user_friends permission in order to appear in the response to /me/friends. See the Facebook upgrade guide for more detailed information, or review the summary below.
If you want to access a list of non-app-using friends, there are two options:
If you want to let your people tag their friends in stories that they publish to Facebook using your App, you can use the /me/taggable_friends API. Use of this endpoint requires review by Facebook and should only be used for the case where you're rendering a list of friends in order to let the user tag them in a post. If your App is a Game AND your Game supports Facebook Canvas, you can use the /me/invitable_friends endpoint in order to render a custom invite dialog, then pass the tokens returned by this API to the standard Requests Dialog. In other cases, apps are no longer able to retrieve the full list of a user's friends (only those friends who have specifically authorized your app using the user_friends permission). This has been confirmed by Facebook as 'by design'.
For apps wanting allow people to invite friends to use an app, you can still use the Send Dialog on Web or the new Message Dialog on iOS and Android.
UPDATE: Facebook have published an FAQ on these changes here: https://developers.facebook.com/docs/apps/faq which explain all the options available to developers in order to invite friends etc.
Hi Steve,
Question 1: Is there a chance that we developed with Facebook API 1.x, then upgraded to 2.1, and as a result we can now only see friends in our app, that have already added the WeVote app to their Facebook accounts?
I think we developed with Facebook API 2.x. Yes, you are right about, Initially i did Facebook friending with me/friends API in which we can only see friends in our App, that have already added to WeVote app.(This codebase is with facebookFriendsAction API which you mentioned) But After some research, we tried to make our App as gaming app so that we could get all Facebook friends .Cdebase for the same is at WebApp side. When you go to network and select choose from Facebook then it will redirect you to /facebook_invitable_friends page. In routes/FacebookInvitableFriends file you can get the logic where i am using /me/invitable_friends endpoint to get all non-app-using friends. We are not storing that friends list in our database. Here if you have not signed-in with Facebook then it will ask you to sign in with user_friends permission(Logic is at: FacebookActions.js line 107)
Question 2: When you debug the python server at line 664 in import_export_facebook/models, do you get a list of all of your facebook friends or just those who have signed up for WeVote? (I get an empty list, just like in the API Explorer) https://developers.facebook.com/tools/explorer/?method=GET&path=1184925174944744%2Ffriends&version=v2.10
Yes, you will get empty list as nobody in your Facebook friends list is using WeVote App. I think right now this code is not useful for getting Facebook friends. Maybe we can remove this code.
Lemme know if you any issue,happy to help you.
This problem probably only occurs if you are using a local python server, and login to local with facebook, before logging into the live instance with facebook. Here is how you get out of the situation where you are logging in, but not seeing any friends:
If when you press the press the "f Choose Friends" button, no friends show up...
1) Get the FACEBOOK_APP_ID: value for your config.js from Dale. Also put that same value in your server side
"SOCIAL_AUTH_FACEBOOK_KEY" in the environment_variables.json file. The environment_variables.json file also
requires a SOCIAL_AUTH_FACEBOOK_SECRET" value to be set that Dale will give you.
2) Go to your facebook home page, go to settings then apps. Delete the WeVote app if it exists.
3) Go to the live server at https://wevote.us/welcome
4) Logout if you are logged in
5) Login with facebook (and note that within the login pop-up you are agreeing to "We Vote will receive:
your public profile, friend list and email address")
6) You now should be able navigate to "Network" in the live WeVote app, press the "f Choose Friends" button,
and see a list of your friends.
7) After these steps you should be able to login with facebook on your local server, and see the
invitable_friends list.
My testing shows the retrieve_facebook_friends_from_facebook() function not working at all. It is called on every facebook login. The client side FacebookInvitableFriends.jsx does show "invitable_friends" from facebook. If FacebookInvitableFriends does not appear to work, try the workaround in the previous note, which is also in a comment in FacebookInvitableFriends.jsx
Hi @SailingSteve, feel free to modify that function to return a "success" result without executing. We can then refactor the code that calls it to stop relying on it. Thank you!
Talked: Comment out the python side, remove the call on the React side with a note saying deprecated for now.
Resolved.
In /Users/stevepodell/PythonProjects/WeVoteServer/import_export_facebook/models.py @ 652 the API call always returns an empty set.