PhoneGap的建立连接Facebook插件(Android版) [英] Phonegap Build facebook Connect Plugin (android)

查看:157
本文介绍了PhoneGap的建立连接Facebook插件(Android版)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用带的PhoneGap构建Facebook的插件,一个奇怪的问题。
这听起来像一个证书有问题,但我不能弄明白。

I have a strange problem using the facebook plugin with phonegap build. It sounds like a certificate problem but I can't figure it out.

我试过样品code在这里找到:github.com/amirudin/pgb-fbconnect

I tried the sample code found here : github.com/amirudin/pgb-fbconnect

我也跟着在readme.md文件的说明。

I followed instructions in the readme.md file.

当我第一次开始的Andr​​oid应用程序,当我点击登录按钮,一切工作正常,我可以自己连接到Facebook应用程序。

When I first start the android app and when I click on "login" button, everything works fine and I can connect myself to the facebook app.

现在,我打注销按钮。再次单击OK,它的工作原理。

Now, I hit the logout button. Ok again, it works.

但是,如果我再次点击登录按钮,我有一个Facebook的错误信息:无效的android_key_parameter关键XXXXXXXXXXXXXX不符合任何允许的关键。

But if I hit the login button again, I have a facebook error message : "invalid android_key_parameter. The key xxxxxxxxxxxxxx does not match any allowed key."

但该消息中的关键XXXXXX不对应,我已经把在Facebook应用程序配置面板的关键。

But the xxxxxx key in the message does not correspond to the key I've put in the facebook app config panel.

我有我的问题的小视频在这里: Dropbox的影片

I have a little video of my problem here : Dropbox video

我不明白为什么它在第一次登录时工作正常,第二个过程中失败....看来,第二次,签名更改。

I don't understand why it works fine during the first login and fail during the second one .... It seems that the second time, the signature change.

帮助!

我创建了一个 GitHub库的,如果有人想对它进行测试。你只需要更改config.xml中APP_NAME和APP_ID和APP_ID index.html中。

I created a github repo if someone want to test it. You just have to change the APP_NAME and APP_ID in the config.xml and the APP_ID in index.html

这是非常令人沮丧,有一些东西,差不多的作品。

It's very frustrating to have something which "almost" works.

你再现我的错误/行为成功吗? (登录注销+ +登录失败=)

Did you succeed in reproducing my bug/behavior ? (login + logout + login = fail)

推荐答案

你是因为你没有使用权的密钥存储文件,签名密钥,密钥算法面临的问题。你需要生成你的Andr​​oid键(S)的哈希值,并提交给那些在开发网页在Facebook上。

The problem you are facing because of you are not using right keystore file, Signed key, and key algorithm. You will need to generate a hash of your Android key(s) and submit those to the Developers page on Facebook.

如果您正在生成Windows上(特别是64位版本),该哈希,请使用OpenSSL的版本0.9.8e或0.9.8d为Windows而不是0.9.8k。

If you are generating this hash on Windows (specifically 64 bit versions), please use version 0.9.8e or 0.9.8d of OpenSSL for Windows and not 0.9.8k.

一旦你下载的OpenSSL,打开命令提示符(cmd.exe的)以管理员身份,然后运行以下命令:

Once you download openssl, open the command prompt (cmd.exe) as an Administrator, then run the following command:

keytool -genkey -v -keystore [keystore_name].keystore -alias [alias_name] -keyalg RSA -keysize 2048 -validity 10000

请注意, ALIAS_NAME ,并保留所有密码的Andr​​iod

Please note the alias_name, and keep all passwords andriod

现在,去你的PhoneGap帐户>>编辑帐户>>点击签名密钥卡>>点击添加键......并提供以下信息:

Now, go to your phonegap account >> edit account >> Click on signing keys tab >> Click 'add a key...' and supply the following info:

Title - anything

Alias - alias_name that you have given while generating the keystore file.

然后,创建使用您生成,然后更新您的Facebook应用程序,散列键密钥库文件中的新的哈希键。

Then, create a new hash key using the keystore file that you generated and then update that hash key in your facebook app.

下面的命令用来生成散列关键字。

Use below command to generate hash key.

密钥工具-exportcert -alias [ALIAS_NAME] -keystore [keystore_filename.keystore] | OpenSSL的SHA1 -binary | OpenSSL的BASE64

这应该是它!

这篇关于PhoneGap的建立连接Facebook插件(Android版)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆