javascript - 构建桌面 Facebook 应用程序

标签 javascript facebook facebook-graph-api

我正在尝试构建一个桌面 Facebook 应用程序,它将显示登录用户的好友列表。我正在尝试使用 Facebook javascript SDK 来做到这一点。但是,当我打开 HTML 页面时,出现以下错误:

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the Application configuration. It must match one of the Connect or Canvas URLs or domain must be the same as or a subdomain of one of the Application

据我了解,Facebook 要求提供调用该应用程序的 URL。不过,我想通过从本地驱动器打开 HTML 文件来运行它,而不是通过网站。这可以做到吗?

Facebook 上有一篇帖子 ( https://developers.facebook.com/bugs/165982843535513/ ) 表明这可能是不可能的。然而这篇文章是大约3年前发布的。目前有可能解决这个问题吗?

最佳答案

您必须构建手动登录流程:

To use Facebook Login in a desktop app, you'll need to be able to embed a web browser (sometimes called a webview) within the app to perform the login process.

来源:https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.3

以防万一您不知道,您只能找到也授权您的应用程序的 friend 。

关于javascript - 构建桌面 Facebook 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30613373/

相关文章:

javascript - 在点之间移动图像

android - iOS\Android Facebook SDK - 获取好友列表,有些没有用户名

android - 由于 facebookconnect 插件,Android 的 Phonegap 构建失败

facebook-graph-api - 什么时候使用 getGraphObject 和 getGraphEdge

javascript - 清除 DataTable 上的 saveState 不能正常工作

javascript - 如何通过表单外的元素在移动设备上提交表单

javascript - 无需连接到 Facebook 即可获取访问 token

javascript - 在页面上找到img标签,创建og :image meta tag and append to head

javascript - jQuery 文本编辑器 (JQTE)

javascript - fb.api 在连接的用户上返回 'undefined'