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 Friends issue

Author
Message
Effishen
9
Years of Service
User Offline
Joined: 13th Jun 2014
Location:
Posted: 7th Jan 2015 14:27
Hi Guys

I have a slight issue with Facebook, hope someone has a way to work around this.

Right now this is what my App does

1.) App connects to Facebook
2.) App requests for list of friends from Facebook
3.) App sends list of friends to personal PHP server
4.) PHP Server sends 2 names back to App (the person scoring higher than player, and the person scoring lower than player)
5.) App displays the names

Right now, the list of friends is small, but I think this is not a very elegant solution...

Does anyone have a better idea?

Thanks a lot.

Effishen
haliop_New
User Banned
Posted: 7th Jan 2015 20:20
hi do you use tier 1 or 2 ?
im having a probelm with login to facebook since i have no idea why the android hash key dosent work.. any thoughts ?
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 7th Jan 2015 23:58
In WS (Wordspionage) I do similar, but list all friends.
What we do is connect to the server, search for matching FB ids to determine if their friends are also players, then we add a WS icon by their name. The list first shows friends that are WS players in alphabetical order and then the remaining list of their friends. This gives them full control over who they might want to send a message to. If the friend is already a WS player and has a push token registered with us and has played in the past couple of weeks then we just allow a game to be created normally. If they are not a WS player or they have no push token registered or they have not played in the past couple of weeks then we ask the player if they want to send them a message on FB in addition to creating a new game. If they are not a WS player then we only allow a message to be posted on the friend's wall.

@haliop_New
You should probably set up 2 hash keys on the FB app page. One is for when you use the debug keystore to sign the app, the other is for the release keystore.
To get the hash key from the keystore you can use this command line
keytool -exportcert -alias <yourAlias> -keystore <keystore path & file name> | openssl sha1 -binary | openssl base64
Keytool.exe is in your JDK/bin, you will need Java Development Kit (JDK) installed on your machine.

xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 8th Jan 2015 04:36
Facebook changed provate settings again.
You need the last framework and follow the facebook guide to allow this new rules.
I hate facebook

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 8th Jan 2015 04:37
I like it on Unity. Took me a total of 15 minutes to set up...

Effishen
9
Years of Service
User Offline
Joined: 13th Jun 2014
Location:
Posted: 8th Jan 2015 11:05
Hello Naphier

Thanks for the information!

Is there any way, for my PHP server to retrieve the list of friends directly from FB, and hence saving my App some cpu cycles / network bandwidth.

If I understand correctly, the new FB rules don't allow you to list all friends anymore, only those who have the app installed.

Effishen
Effishen
9
Years of Service
User Offline
Joined: 13th Jun 2014
Location:
Posted: 8th Jan 2015 11:07
haliop_new

I had a similar issue, then I realised the error message that says your fb hashkey is wrong contains the actual hash key.

You can make it work by adding that hash key into the FB app page


hope im making sense. I don't have any screenies to show you.

Effishen
haliop_New
User Banned
Posted: 8th Jan 2015 11:25
hmmm very intersting i will try it now , thank you.
haliop_New
User Banned
Posted: 8th Jan 2015 11:30
nope that didnt work it wont even give me to add it..
Effishen
9
Years of Service
User Offline
Joined: 13th Jun 2014
Location:
Posted: 8th Jan 2015 17:53
make sure that the agk player is properly and completely closed between debug tests. it messes with fb login.

Effishen
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 8th Jan 2015 20:23
When testing you might want to add a way to call FacebookLogout, this will let you retry the login without having to terminate the app.

Apps made after a certain date might not have access to the full friends list. I'm trying to get Paul to update Facebook. They've now switched to "invitable friends". Which means they pick your friends that either play that game or have a history of playing games. It's not fully clear if you can't get the actual list of friends to send them a message though. You just can't send them an invite - AppGameKit doesn't have the ability to send invites anyway. Getting the friends list might just require its own permission now.

Get the hash key with the above method for both your debug keystore and your development keystore, enter them into your FB app page, follow their instructions on setting up the app page and you should be all good. Also if you search Google for how to get the hash key you'll see alternative methods, but I think they all require use of modifiying the java code for AppGameKit via Eclipse.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Feb 2015 12:27
I'm not entirely clear what the debug keystore is? Is it to allow you to use the AppGameKit Player? Does this mean I have to compile my own AppGameKit Player?

Quidquid latine dictum sit, altum sonatur
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 21st Feb 2015 00:35 Edited at: 21st Feb 2015 00:40
AGK packages are signed with keystore files.
By default I believe AppGameKit IDE signs the exported APK file with the debug keystore. On Windows 7 it is found in the location:
C:\Users\<username>\.android\debug.keystore
However, this is where Eclipse / Android SDK creates it. I am not entirely sure that is where AGK's IDE looks. In fact there is one in this location:
C:\Program Files (x86)\The Game Creators\AGK_2.0.11\Tier 1\Editor\data\android\
Where "AGK_2.0.11" is your installation directory for AGK2, mine is custom.

I was only just brought aware of this.
For development/publishing you want to create your own keystore. It looks like that can be done through the IDE via the Tools/Android/Generate Keystore option.

You can use those keystores to sign your application via the IDE (which sort of builds your own player, but it doesn't have broadcast receiving ability - i think).

Usually you use a debug.keystore across many applications and then the generated keystore for a single application. It is VERY important that the production/generated keystore you use when signing the application and submitting to Google is kept safe and backed up. If you lose this keystore you cannot update your application. You cannot replace it. It is what verifies your identity as a developer with rights to that application. We lost the keystore for the original dFenz and had to create a new application with what we wanted to be an update. It lost us probably 500 active players.

Finally... for FB integration you'll almost always use two hash keys. One from the debug.keystore and one from your production keystore when you're ready. To generate the hash keys you need JDK. And then you need to manually do this command:

Quote: "keytool -exportcert -alias <yourAlias> -keystore <keystore path & file name> | openssl sha1 -binary | openssl base64
Keytool.exe is in your JDK/bin, you will need Java Development Kit (JDK) installed on your machine."


Many development environments do this for you and it would be SUPER handy if AppGameKit did it. If that solution doesn't work for you out of the box then there are lots of posts about it on places like Stack Exchange, because EVERYONE has problems with it. Thank Facebook, for such high and meaningless security

I hope this helps clear things up for some of you. Unfortunately I don't know 100% of what the new IDE is doing and I've had to do everything manually via Eclipse in the past. Lots and lots of Google searching to get it right. Fortunately, developers.facebook.com has been updated a lot in the past couple of years and has all of this information as well (well... not all of it but most and it's not necessarily new-developer-friendly).

EDIT:
I forgot to add: I removed my personal permissions for Wordspionage on my Facebook settings/apps page and then reauthorized. I no longer can see ALL of my friends, but only friends who have installed the app. This is a Facebook policy update and it stinks. You also can no longer post to a friends wall via Facebook SDK. I have provided Paul with code that will allow you to invite friends via an app request (we all love them! but hey, they work for many companies - so love or not, they do as intended). Hopefully Paul will be able to update the Android integration with that as well as iOS because I'm sure it also has issues. An alternative is to allow users to post to their own wall and tag friends. I do really wish that AppGameKit would simply use Facebook's default views to do all of this. They have an awesome friend picker with full UI that would save AppGameKit users a lot of hassle.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 21st Feb 2015 10:45
Thanks again Naphier. I think I have all of it right other than the debug key.

So is the debug Hash the one that starts Xb6G...?
I've just manually entered it, I can't find anywhere to simply copy and paste it in.

Quidquid latine dictum sit, altum sonatur
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 21st Feb 2015 23:14
Yeah it's a hash string of characters and numbers. Maybe 16 characters long (can't remember).
If you're running keytool.exe from the command prompt window you should be able to copy it out of there via the command prompt window's alt menu.

3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 21st Feb 2015 23:56 Edited at: 21st Feb 2015 23:59
can alias name have a space in it when you compile it in eclipse. Do you have to put quotes around alias name if you have a space in it? The eclipse page says an alias name example without a space.

http://wiki.eclipse.org/Generating_a_Private_Key_and_a_Keystore

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 21st Feb 2015 23:58
I would generally think it is a bad idea to put a space in the alias name. I recall something about issues with non-alphanumeric characters used in the keystore file details (like names, company name, etc.) In short: I wouldn't do it.

Login to post a reply

Server time is: 2024-05-18 17:21:22
Your offset time is: 2024-05-18 17:21:22