如何获得 Facebook 应用程序的流畅弹出权限窗口?目前,用户必须转到应用程序页面,然后它会重定向他们重新登录 Facebook,这根本不是我想要的。
我目前正在使用 PHP 进行身份验证 - 这是正确的语言吗?我应该使用 Javascript 还是其他方法?我只想进行一次干净的登录/权限授予,完成后将定向到应用程序。
最佳答案
自带的弹出权限窗口是配合javascript SDK使用的。使用OAuth,您可以使用javascript获取权限,然后与php SDK共享信息。
您所要做的就是在js SDK的FB.init
中设置cookie: true, oauth: true
。
Used in conjunction with the JavaScript SDK, the PHP SDK can share user sessions seamlessly across the client and server. If a user is already logged in to their Facebook account, the JavaScript SDK will pick up the login session and send it to the server via a cookie, which the PHP SDK reads without any intervention on the developer's part. Example here.
关于php - 弹出权限窗口 Facebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7762052/