Using FaceBook Sdk in my Unity Game (Login and User's FB_id) - facebook

I've been working with integration of Facebook sdk in my unity game. In the first page I kept a fb login option and I'm trying to fetch the player's fb_id(with which I will be making an online leaderboard). I'am facing two problems.They are:
Only my apps developers, test-users and owner(me) can login only first time. If i clear my apps data I face a hash key validation problem. There will be a screenshot below.
I need the fb_ids of all users . But I am getting only the fb_ids of people who has roles (owner, developer and test users) . How can I get the fb_ids of all users?
NB: My game is published in google play and reviewed by Facebook with necessary permissions.
Google Play Link: https://play.google.com/store/apps/details?id=com.BLI.CatchTheBaby&hl=en

Facebook SDK does not allow you to get data of all users.
Their API returns only your friends ids,name etc. Here is an online tester of Graph API: https://developers.facebook.com/tools/explorer/
If you want to get all users FB IDs you have to store them on your online database like this: When user is doing his first login to Facebook from your app, you are sending returned id to database by some kind of webrequest. Then you can fetch data with all users IDs.

Related

facebook application for login and messenger same ids?

I am building a facebook messenger bot. And the bot is giving user ids. But it is not clear to me if the messenger ids are the same ids that would be returned if I use the same app and add to it a login feature. Because we already have an app and has a login feature, now we need to build a facebook bot and identify the already existing users in our db that are using the bot.
I have read facebook tutorial about linking 2 different applications to the same business to get consistent ids. But what if I use that same application to login users AND for messengers (by using the add products to the application, and so having one application, one app id) would that work? Would I be getting the same user ids?
PS: I would test myself but I am in an awkward position where the page/database/login app owner is a different person, and they are not big on sharing data, and I am supposed to blindly write a messenger code that is supposed to work when they deploy it.
All help is appreciated, thank you.
You need to use Facebook's ID Matching APIs for this purpose:
Here is the details: https://developers.facebook.com/docs/messenger-platform/identity/id-matching

Facebook Graph API: how to get online friends / or active last X minutes

Past & Now
A few years back, Facebook supports FQL in v2.0 to retrieve online friends of an user ( Facebook : Get List of Online Friends Using Graph api )
However this FQL is removed from v2.3, and what's worse is Facebook completely removed Chat API (XMPP) from April 2015.
Goal
Is it still possible to generate a list of Facebook friends and their last active time / currently online using Graph API / or any other method? (basically the same as chat window on Facebook desktop)
This would be useful:
when a user wants to see who's online but don't want to let their friends know they're online atm
or for a simple widget on phone screen, where user can have a quick look at who're online without the need of Facebook login (the widget gets data from 3rd party server which uses API / or some other method to provide that list)
Thanks alot for your input
No, it is not possible - because as you found out already, Facebook removed the required permission/endpoint. The only way would be implement your own routine for this. For example, by storing the timestamp of visiting users. Whenever a friend of that user visits your App too, you can show those to him. Of course it only works for users who authorized your App and youi can only detect if users are online/active in YOUR App, not on Facebook.

How to access Game state on Google Cloud with Facebook ID?

I am trying to access game state from Google server of a Facebook friend. I fetch the List of Facebook friends from Facebook SDK and get a Facebook-id of a friend in return. Game state is present on Google server against Google-id. How can I form a mapping between these two? I want to achieve this without involving any other server.
To dTo get this right you need involving other server.
Although you can do is create a list in a local file, with the relation google user - Id facebook

Get all the facebook Application user details

Am a facebook game developer. i have developed a game and am using facebook log in facility.but still now i want store the my app user id in my database.
but am interested do Rank the user based on their score. hence i need there all the user of my game.
so it any possibility to get the all registered user ID from Graph API/ or in any other way?
when the user is registering your app or authorizing it, store the user details in your own table. That would be a better option. Or you have to use FQL on insights object to get the application installed users.
https://developers.facebook.com/docs/graph-api/reference/insights
There you have a property called "application_installed_users"

How to find out which of your facebook friends are also using your mobile app?

We are building mobile app that uses Facebook for registration (know how to do this).
We would like to have a screen, where all your friends would be listed with indication, if they also use our app.
How should we save data (client, server) that one facebook user is also our app user?
When you're already using Facebook for authentication, you probably already have a column in the user table in your database that holds Facebook profile ids of each user. If you want to distinguish between them, just add a column modeling if that user is also using your mobile app.
By issuing a request to https://graph.facebook.com/PROFILE_ID/friends as described in the Facebook Graph API Documentation you can get the list of friends for a certain user without requiring any additional permissions.
Now just build the intersection between the friends list of the user and your (mobile app) user base and you got the list of his friends that are using your mobile app. You should of course do this comparision on the server, so you don't have to send the Facebook ids of your complete user base around.