美文网首页
APP调用Facebook登录

APP调用Facebook登录

作者: 四季变幻 | 来源:发表于2018-06-16 01:13 被阅读156次

背景:我是做服务端的

资料:

https://developers.facebook.com/apps/446477899127843/dashboard/(这是我的应用控制面板,你打开会到你的控制面板,这里获取appid、appsecret以及设置回调URL等)

https://developers.facebook.com/docs/facebook-login/overview(开发文档)

工具:

https://developers.facebook.com/tools/explorer/(Faceboo API探索工具)

正文:

Facebook提供了四种登录方式:

1,IOS

2,Android

3,网页(含Javascript或PHP) https://developers.facebook.com/docs/web

4,其他(手动构建登录流程) https://developers.facebook.com/docs/facebook-login/advanced

头像这样获取?

https://graph.facebook.com/" + uid + "/picture

http://graph.facebook.com/{user-id}/picture?type=large(square, small, normal, large)

http://graph.facebook.com/{user-id}/picture?width=100(200,300...)

我采用的是PHP SDK,手动构建登录流程貌似是极端情况才用。

注意事项:

1,回调URL必须启用 HTTPS

2,使用PHP SDK要求php版本 >= 5.6

ps:

1,手动构建登录流程时有个地方用到“access_token”,网上说这个东西通过“appid|appsecret”拼接而成。

2,php SDK:https://github.com/facebook/php-graph-sdk

其他参考:http://cwqqq.com/2017/12/06/facebook_login_api_server-side

相关文章

网友评论

      本文标题:APP调用Facebook登录

      本文链接:https://www.haomeiwen.com/subject/eeuveftx.html