Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Facebook Key hash generation for AGK v2...

Author
Message
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 13th Feb 2015 21:31
Hey Guys,

Is there any chance we could get the option to create the Key hash required by Facebook to the AGK2 IDE?

I used to use the one on the online apk creation tool, but I have a sneaky feeling that the key provided works only with AGK1.

In the mean time, is there any other way of getting the hash key without having to go the whole hog and setting up Eclipse? Again, I'm not sure how easy this would be and I don't think there is an AppGameKit v2 installation guide yet is there?

Thanks in advance.

=PRoF=

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Feb 2015 22:43 Edited at: 13th Feb 2015 22:45
You don't need Eclipse.
The information below is a short version of the Guide/Facebook page of the help files, plus a little extra for creating the keystore.

You can set up the Java SDK (from Oracle site) and Openssl

In Java bin library (for your installation), run:

C:\Program Files\Java\jdk1.8.0_31\bin>keytool -v -genkey -v -keystore "c:\keystore\my.keystore" -alias myalias -keyalg RSA -validity 10000

Java location may differ for release and your install location.
my.keystore is your keystore name and location
myalias is your alias

For the hashkey:

In Java/bin library, run:

C:\Program Files\Java\jdk1.8.0_31\bin>keytool -exportcert -alias myalias -keystore "C:\my.keystore" | "c:\OpenSSL\bin\openssl" sha1 -binary | "C:\OpenSSL\bin\openssl" base64

Again, change the paths and names to suit your instalaltion

I did this about a week ago and it worked ok. It took me about 2 hours to work it all out, hopefully this shortcuts the process for you!

Quidquid latine dictum sit, altum sonatur
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Feb 2015 01:05
The online tool will also work for keystores generated in AGK2.
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 14th Feb 2015 05:51 Edited at: 14th Feb 2015 05:58
It does not work in Microsoft 2013 in their 2. But I think it will work tier 2 in eclipse because of the Facebook plugin. I do not know why it does not work in Microsoft c++, but I haven't tried what they said above this comment yet. I don't have openssl installed so I should try this.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 14th Feb 2015 21:44
@Batvink:
Thanks for that, that was relatively simple and painless to do

Although now it seems I'm having another issue. Every time I'm connecting to facebook, the app crashes *sigh*

Has anything changed with AppGameKit recently with the FB commands? I'm pretty sure I've not changed anything in my code from the last time I used it.

In fact, I just tested my test code with the details from a working FB app account (with the new key hash added obviously), and I get the same problem.

I'm using AppGameKit v2 Build 11, does anyone out there have the FB post to wall command working successfully? Or is this a bug?

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Feb 2015 22:08
Quote: "Has anything changed with AppGameKit recently with the FB commands?"


I noticed the FaceBook SDK got upgraded to V3 in AppGameKit V2.0.11
I have only got as far as connecting to my account at the moment. I'll be back on it next week hopefully.

Quidquid latine dictum sit, altum sonatur
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 14th Feb 2015 23:07
Hmm, nothing seems to work? Even this snippet, which has all the FB commands removed except the bare minimum to connect.



I compiled as an APK from the AGK2 editor, and tested it on 2 devices (My Note 3 and Tab 2 7.0) with the same results. The app starts, then closes with a "The app has stopped" error message.

I have included the compiled app in case anyone wants to try that.

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Feb 2015 09:53
Crashes for me too.
I managed to connect with my app, but the the name and id are blank.

This is my first foray into Facebook so I can't really comment on how it should work.

Quidquid latine dictum sit, altum sonatur
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 15th Feb 2015 12:55 Edited at: 15th Feb 2015 14:18
In the help section it does not say how to compile apk for facebook in in eclipse using tier2. I have a question though generating this using a bytecode will this generated file work with tier 2, because tier2 does not generate bytecode. I wonder if you can make a bytecode that does not contain the completed code and is named the same in c++ to get this to work.

Quote: "

Note that the AppGameKit Facebook commands using your App ID will not work properly in the AppGameKit Player as the bundle ID and package name will not match those help by Facebook. You should compile your own app in XCode or Eclipse (or use our online APK service) to get an app that can properly communicate with Facebook."


So I wonder if you can fool the webpage by not giving your c++ code but instead making a tier 1 app with the same name and then use it for teir 2 apps.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 18th Feb 2015 17:40
Update here on the situation, for Paul to review.

Quidquid latine dictum sit, altum sonatur
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 20th Feb 2015 22:01
I think my app crashing issue was caused by a borked install of AGK. After trying and failing repeatedly to get even the simplest FB applications to work, I uninstalled and reinstalled v2.0.11.

This appears to have fixed any issues I had with the simple test apps. I will try and see how it works with the proper project shortly.

Login to post a reply

Server time is: 2024-11-25 17:47:46
Your offset time is: 2024-11-25 17:47:46