Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by HundretZero · Mar 26, 2014 at 01:08 PM · pluginfacebookprime31social networking

SHA1 Hash same as Facebook Hash? (prime31 social plugin)

hello!

i want to integrate facebook in my app, so i created a facebook app on facebook and installed the prime31 social plugin for android.

i added the package name (my app's package name) and the class name (as descriped by prime31) on the facebook developer site at my app. facebook also asks for a hash key.

my question now is: is the hash key the same i need to add in google developer console when linking an app for in app billing? (the hash key i got from my .keystore file) because i already have this key and used it to link my app for in app purchases. the key looks like "20:C0:F5:F4........"

but concerning facebook - i read some ppl wrote you have to get your hash key from the .keystore file by using keytool and some long command looking like

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

do i need to do this for FACEBOOK as this hash key is different from the one i used for google developer console? sorry i am not into all this yet and i am a bit confused... and when i start the testscene of prime31's social plugin nothing works and i only get a "valid session? false" in the debug log

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dblfstr · Mar 26, 2014 at 01:14 PM 0
Share

yes, you get the hash key from the keystore using the command you noted.

 keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
avatar image Dblfstr · Mar 26, 2014 at 01:19 PM 0
Share

If you watch the logcat log when trying to access facebook, it will tell you what is happending. SOmeething like hash XXXXXXX (Whatever hash) not found. or something like that. Also note, sometimes facebook will replace certain characters in the hash.

here is an enexample of a hash that facebook wants.

 NteSLOyHHHx1-WUnrW0NEbwcY2Y=

The hash you create might look like this:

 NteSLOyHHHx1+WUnrW0NEbwcY2Y=

Notice the '+' and '-' are switched.

avatar image HundretZero · Mar 26, 2014 at 01:24 PM 0
Share

thanks very much!

but it says i need OpenSSL.exe to use this command. i am using a mac. any alternatives? ;)

i wonder why it's so inconvenient to create this hash...

avatar image Dblfstr · Mar 26, 2014 at 01:29 PM 0
Share

Yes, you have to install openssl, and either add it to your path (don't know the term for a mac), or place the actual address in the place of openssl.

avatar image Dblfstr · Mar 26, 2014 at 01:33 PM 0
Share

Openssl for mac:

http://www.itechtalk.com/thread7108.html

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Dblfstr · Mar 26, 2014 at 01:26 PM

Here is a great post on how to get the proper hash for facebook. It links the proper ssl to get the correct hash (new ssl versions do not create the hash you need. Also, someone in the post made a GUI for getting the hash, I have not tried it. EDIT: The link I posted is more relevant to windows, put the process is the same on a mac.

http://stackoverflow.com/questions/4388992/key-hash-for-android-facebook-app

EDIT 2:

Openssl for mac with a little info:

http://www.itechtalk.com/thread7108.html

The method for getting the hash is what you noted.

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

That is obviously for the debug key, you replace the debug with your relevant info. NOTE: you will get a hash even if the you mistype the password, etc. Of course, this hash will not work, but it will still give you one. Real pain in the butt.

Also note, sometimes facebook will replace certain characters in the hash. Here is an example of a hash that facebook wants.

 NteSLOyHHHx1-WUnrW0NEbwcY2Y=

The hash you create might look like this:

 NteSLOyHHHx1+WUnrW0NEbwcY2Y=

Notice the '+' and '-' are switched.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HundretZero · Mar 26, 2014 at 01:37 PM 0
Share

thanks very much. i think i got all info i need now. very annoying this is so difficult. but i should work out

avatar image Dblfstr · Mar 26, 2014 at 01:48 PM 0
Share

No problem.

avatar image
0

Answer by JigneshKoradiya · Aug 02, 2015 at 04:54 PM

https://youtu.be/VD9UfjnPF-I

this will help you to solve your problem

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to "Like" facebook page ? 0 Answers

Facebook plugin problems 1 Answer

Prime31: Posting To Facebook 0 Answers

A node in a childnode? 1 Answer

introducing "safe" DLL causes internal compiler error 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges