Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by diegomh7 · May 19, 2016 at 11:50 AM · facebookapihash

[SOLVED] Facebook working until signed version then hash doesn't match :(

I'm working on a new game (same as everyone else), I've integrated Facebook following their guidlines, my app when I build it and send it to my phone works fine, I exported a signed version to upload to google play and put the same version on my phone, now I can't log in on the phone as I get a facebook 'invalid hash key' does not match stored hashes' error message.

Is this just because its a signed version put on my phone and everything is actually fine or is this because I did something wrong signing the package or something else?

Thanks in advance :)

Diego

[SOLVED UPDATE] I needed to generate a key in unity and save it tutorial here : https://www.youtube.com/watch?v=iBmgCnJ_z1k&feature=youtu.be

Then use terminal on my mac and run the following command : keytool -exportcert -alias -keystore | openssl sha1 -binary | openssl base64

Swapping my release key alias and path for the name of the user in the keystore and the path to the file where I stored my keychain

If you get a syntax | error, don't use <> brackets when entering the username and path to the file.

I then copied the hash from terminal and pasted it into the facebook dev console.

Then finally I ran my app go the same error but a different hash, I copied that off my phone and pasted that into facebook dev console (so there are now 3, the debug one from fb sdk in unity, the generated one by terminal and the one from my phone). Done. for now....

Onwards and upwards to the next hurdle....

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Niks4Linux · May 19, 2016 at 12:01 PM

How did you created your hash? Did you use the hash from the Facebook Settings in the Editor or you created your own hash from command prompt? I had the same problem but, I have created my own hash from command prompt using this step by step tutorial to create hash (15 steps are given) -

http://stackoverflow.com/questions/5306009/facebook-android-generate-key-hash

Try this tutorial and use that hash and upload the build. Maybe this will solve your issue. It worked for me.

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
avatar image
0

Answer by diegomh7 · May 19, 2016 at 12:20 PM

I used the editor in unity then copy and pasted it to the facebook app as per their guidelines. It works perfectly fine until I sign the exported apk file and then the same package transfers to my phone and boom, facebook shows a hash mismatch warning message.

Comment
Add comment · Show 5 · 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 Niks4Linux · May 19, 2016 at 12:48 PM 0
Share

Can you try using command prompt to create Hash $$anonymous$$ey? And then try it with your app in both signed and unsigned version or you can copy and paste the same mismatched key into your Facebook app setting and then try. And also check your package name, class name is correct in the app setting. Hope it helps! :)

avatar image diegomh7 Niks4Linux · May 19, 2016 at 01:12 PM 0
Share

I manually added the key shown on my mobile to facebook and still get the same issue, it's wierd how after signing the apk in unity then exporting the hash should change?? I'll try the ter$$anonymous$$al way now and get back to you,

cheers btw

avatar image diegomh7 diegomh7 · May 19, 2016 at 02:04 PM 0
Share

I've tried using open ssl in ter$$anonymous$$al and just get errors, I've looked for tutorials online but I always end up at android developer pages and the content isnt right for my unity project. God knows what I'm doing wrong

avatar image diegomh7 · May 19, 2016 at 02:20 PM 0
Share

I must be doing something wrong when signing the product to cause the hash key to have a mismatch, even if I copy and paste the hash code from my android phone and write it into facebook dev console it still errors when I load the app and try to login, I need some kind of step by step creation of the key and copy that to facebook app dev page, Im using a mac to access openssl if that's any difference.

avatar image diegomh7 · May 19, 2016 at 02:27 PM 0
Share

This will apparently be the solution:

https://developers.facebook.com/docs/android/getting-started#create_hash

Followed by :

https://developers.facebook.com/docs/android/getting-started#release-key-hash

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

54 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to post as Page using the Facebook SDK 1 Answer

How to use result.ResultDictionary to fetch full json of facebook user profile who logged in my app? 1 Answer

Facebook for Windows 1 Answer

Android Post ScreenShot to Facebook 0 Answers

Unity Facebook API read page comments on a post 1 Answer


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