简体   繁体   English

如何获得也将我的应用与Laravel社交名流一起使用的Facebook用户列表?

[英]How to get a list of facebook users that also use my app with Laravel socialite?

Like the title says, I have currently implemented a socialite login on my website but I don't know exactly how to get a list of user friends that also use my app when a user logs in. 就像标题中所说的那样,我目前在我的网站上实现了社交名流登录,但是我不知道如何获取用户朋友列表,这些用户在用户登录时也会使用我的应用程序。

The socialite documentation states the following code example to change the "scope". 社交名流文档说明了以下代码示例以更改“作用域”。 I've read somewhere else that you are suppose to use this? 我读过别的地方,您应该使用它吗?

return Socialite::driver('github')
        ->scopes(['scope1', 'scope2'])->redirect();

Nowhere does it state in the socialite github readme what scope means in this case though. 但是在社交名媛github自述文件中没有任何地方说明范围在这种情况下意味着什么。 Is this simply a social media api thing? 这仅仅是社交媒体api吗? Hopefully somebody can help me out. 希望有人可以帮助我。

It also states that setting up a scope with override all existing scopes, what are the default ones to begin with? 它还指出,使用覆盖所有现有作用域的作用域设置作用域,默认的作用域是什么?

The snippet of code you've provided is indeed correct. 您提供的代码段确实是正确的。 By defining your scopes like that, the user get's an overview of the permissions you require. 通过这样定义您的范围,用户可以大致了解所需的权限。 They see this when loggin in to your application via Facebook. 他们通过Facebook登录到您的应用程序时会看到此信息。

To answer your main question: I don't think Facebook allows you to get a full list of people who use your app. 要回答您的主要问题:我认为Facebook不允许您获得使用应用程序的人员的完整列表。 (At least not with their names) (至少没有他们的名字)

If you just need a number, you should read the docs . 如果您只需要一个数字,则应该阅读docs

I'm not entirely sure about this, so please correct me if I'm wrong. 我对此不太确定,如果我错了,请纠正我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM