且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何获取正在使用您的Facebook应用程序的用户的所有用户ID

更新时间:2023-01-30 09:39:07

有一种方法可以获取所有使用Facebook应用程序的用户的用户ID广泛的研究我得出结论, 没有办法这样做



我发现:

一个旧的REST API,名为 friends.getAppUsers 获取用户朋友的所有ID授权申请。



我希望我发现:

阅读 App Login $ 验证文件中的c $ c>部分:


除了用户登录,Facebook
平台支持应用程序登录使用
OAuth 2.0客户端凭据流。
App登录允许您为您的应用程序
采取各种
管理操作,例如检索Insights数据或
批准请求。


我以为 application 对象将有一个直接的方法(类似于帐户):

  $ facebook-> api(/ APP_ID / users); 

但我错了。然后,随着见解功能的引入,我很震惊,你只能获取用户ID的计数



您可以做什么:

一旦用户授权您的应用程序,将用户ID存储在数据库中,如果您的应用程序已经有用户(很可能是这种情况),请检查每个用户是否在您的数据库中与应用程序进行交互的记录...这样,您将无时间地获得活跃用户的用户ID 。


Is there a way to get the user IDs of all the people who are using your Facebook application?

Doing an extensive research I concluded that there's NO method to do this!

What I have found:
An old REST API called friends.getAppUsers that gets all the IDs of the user's friends that authorized the application.

What I wish I had found:
After reading the App Login section in the authentication document:

In addition to User Login, Facebook Platform support App Login using the OAuth 2.0 Client Credential flow. App Login allows you to take various administrative actions for your app, such as retrieving Insights data or approving Requests.

I thought the application object would have a direct method for this (similar to accounts):

$facebook->api("/APP_ID/users");

But I was wrong. And then with the introduction of the insights feature, I was shocked that you can only get the count of the User IDs!

What you can do:
Storing the User ID in your DB as soon as a user authorize your application and if your application already has users (most likely the case), check if you have a record for each user that interacts with your application in your DB...this way, you'll get the User IDs for your active users in no time.