Facebook应用内登录webapp

时间:2015-04-08 14:27:01

标签: android ios facebook cordova facebook-graph-api

我正在使用phonegap为IOS和android制作一个webapp。

在我的网站上我有一个使用Facebook的登录表单,我希望,而不是在浏览器中打开Facebook登录,使用应用程序Facebook登录用户。

我在GitHub上发现了这个,这似乎是手机间隙的官方插件

https://github.com/Wizcorp/phonegap-facebook-plugin

当我尝试通过Macbook终端安装它时,我遇到了这个问题:

MBP-di-Andrea:Bparty Andre$ cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin --variable APP_ID=00000000 --variable APP_NAME=BParty
Fetching plugin "https://github.com/phonegap/phonegap-facebook-plugin" via git clone
Error: Command failed: /bin/sh -c git clone "https://github.com/phonegap/phonegap-facebook-plugin" "/var/folders/t3/bzvxk7td567_y58nl1nsclbw0000gp/T/git/1428503102506"
xcrun: error: active developer path ("/Volumes/Xcode 1/Xcode.app/Contents/Developer") does not exist, use `xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)

    at ChildProcess.exithandler (child_process.js:751:12)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Socket.<anonymous> (child_process.js:1183:11)
    at Socket.emit (events.js:107:17)
    at Pipe.close (net.js:485:12)

我有一些问题: -我怎么解决这个问题? - 安装手机差距后,我如何使用Facebook应用内登录而不是浏览器? - 有更好的方法吗?

1 个答案:

答案 0 :(得分:0)

为此目的使用插件是正确的方法。 您遇到的问题不是直接连接到该特定插件,而是直接连接到您的Xcode路径。 打开终端并运行:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

之后尝试重新安装插件。