Facebook的SSO例如不工作 - "时出错。请稍后&QUOT再试一次; [英] Facebook SSO example not working - "An error ocurred. Please try again later"
问题描述
我想给Facebook融入我的应用程序等等都跟着教程在: Facebook的Android版一>,但我不能得到的第一个例子(单点登录)的工作。当我的应用程序加载了,我得到了Facebook的对话框,但它只是说:发生错误,请稍后再试。有一个Facebook式的确定按钮,在底部并没有什么在logcat的:
I'm trying to integrate facebook into my app and so have followed the tutorial at: Facebook Android but I can't get the first example (Single Sign-On) to work. When my app loads up I get the facebook dialog but it just says "An error occurred. Please try again later." with a facebook-style "Ok" button at the bottom and there is nothing in logcat:
我也跟着教程的步骤,但我猜有什么不对的应用程序ID或密钥工具生成的hashkey。下面是我遵循的步骤:
I followed the steps in the tutorial but I'm guessing there is something wrong with the APP ID or the hashkey generated by keytool. Here are the steps I followed:
- 在克隆FB的git。
- 创建fbSDK项目。
- 创建自己的FB项目和链接fbSDK作为一个库。
- 在我那么做了密钥工具CMD与OpenSSL和输入密码机器人作为计算器建议的人。
- 我去developers.facebook.com并创建了一个新的应用程序。
- 在编辑设置 - >移动和设备我把在提供的框中我的哈希值。
- 在编辑设置 - >移动和设备我选择本机应用程序的应用型
- 早在我的应用程序复制和粘贴的SSO例如code。
- 我改变了Facebook上的YOUR_APP_ID()函数的应用程序ID为我的新的应用程序显示的developers.facebokk.com页面上。
- 在我跑的应用程序,在我的手机上。
- clone fb git.
- create fbSDK project.
- create own fb project and link the fbSDK as a library.
- I then did the keytool cmd with openssl and input the password "android" as suggested by others on stackoverflow.
- I went to developers.facebook.com and created a new app.
- In "Edit Settings->Mobile and Devices" I put my hash in the box provided.
- In "Edit Settings->Mobile and Devices" I chose "Native App" as "Application Type"
- Back in the app I copy and pasted the SSO example code.
- I changed the "YOUR_APP_ID" in the Facebook() constructor to the APP ID shown on the developers.facebokk.com page for my new app.
- I ran the app on my phone.
我不知道为什么会出现没有在logcat中,但是当我安装它,控制台总是,没有失败,说: ActivityManager:警告:活动尚未开始,目前的任务已经带来了到前面
I don't know why there is nothing in logcat but when I install it, the Console always, without fail, says the:ActivityManager: Warning: Activity not started, its current task has been brought to the front
和我找不到任何的logcat提及我的应用程序或我是从Facebook的SDK这是得到的错误: Facebook的-ProxyAuth(4828):无法读取调用封装的签名
And I can't find any logcat reference to my app or the error I was getting from the facebook sdk which was: Facebook-ProxyAuth(4828): Failed to read calling package's signature.
我已经在这几个小时,现在任何帮助将不胜AP preciated。我不能相信Facebook的SDK和帮助是如此粗略为Android,Facebook的应该是自己感到羞愧。
I have been at this for a few hours now and any help would be greatly appreciated. I can't believe the facebook SDK and help is so sketchy for Android, facebook should be ashamed of themselves.
谢谢
InfinitiFizz
InfinitiFizz
推荐答案
其实我也遇到同样的问题,准确,它解决了。 因此,在哈希密钥生成使用以下步骤:
In fact I have encountered the same problem exactly and it solved. So, in the hash key generation use the following steps:
- 开启cmd,然后去你的Android SDK的路径。
- 键入以下命令: 密钥工具-exportcert -alias androiddebugkey -keystore [你的SDK路径|例如C:\用户\用户] .android \ debug.keystore | OpenSSL的SHA1 -binary | OpenSSL的BASE64
- 在它的PROMET密码输入机器人
- 的结果复制到你的Facebook应用程序设置,并保存设置。
- 在你的Android应用程序使用Facebook应用程序ID(而不是Android的哈希键)。
- open cmd and go to your android SDK path.
- type this command : keytool -exportcert -alias androiddebugkey -keystore [your SDK path | e.g c:\users\user].android\debug.keystore | openssl sha1 -binary | openssl base64
- after that it's promet for password enter "android"
- copy the result to your facebook app settings and save settings.
- in your android app use the facebook app id(not the android hash key).
这篇关于Facebook的SSO例如不工作 - "时出错。请稍后&QUOT再试一次;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!