使用 facebook sdk 为应用程序生成哈希键 [英] Generating hash key for app using facebook sdk

查看:32
本文介绍了使用 facebook sdk 为应用程序生成哈希键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 facebook sdk 登录我的应用程序.该应用程序在 HTC 设备上运行良好.如果没有预先安装 Facebook 应用程序,该应用程序也可以在三星设备上正常运行.

但如果手机上已经有 facebook 应用程序,然后用户安装了我的应用程序,则用户永远不会登录.据我所知,我认为这可能是单点登录的问题,我认为这与生成正确的应用程序哈希键以及在我用来登录移动应用程序的 Facebook 应用程序中使用哈希键有些相关.

请指导我如何创建哈希键.我正在运行 ubuntu 10.4.

当我在终端中运行此命令时:-

keytool -exportcert -alias <您的密钥库别名>.keystore -keystore ~/.android/<您的密钥库名称>.keystore |openssl sha1 -binary |openssl base64

我从来没有被提示输入密码,尽管我得到了哈希键.

解决方案

试试这个:

<前>keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore |openssl sha1 -binary |openssl base64

希望你能明白.我刚刚检查了一下,提示输入密码.

I am using facebook sdk for login into my application. The application runs fine on HTC devices. The application also works fine on Samsung devices if there is no facebook app pre installed.

But if there is already facebook app on mobile and then the user installs my app, the user is never logged in. From what I know, I think this might be a problem of single sign on, and I think this is somewhat related with generating proper application hash key, and using the hash key in facebook application which I used to log into the mobile app.

Please guide me how to create the hash key. I am running ubuntu 10.4.

When I run this command in terminal :-

keytool -exportcert -alias <your keystore alias name>.keystore -keystore ~/.android/<your keystore name>.keystore | openssl sha1 -binary | openssl base64

I am never prompted for password, though I am given the hash key.

解决方案

Try this:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 

I hope you will get it. I just checked it and I got the prompt for password.

这篇关于使用 facebook sdk 为应用程序生成哈希键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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