I achieved authentication between my android app and Facebook profile. I am able to get the logged in user data. However I require to get the users (only) playing the game (step 1).
This is my code so far:
GraphRequest request = new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{user-id}/friends",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
}
}
).executeAsync();
Technically my response should be in JSON format, and I should be able to take from it what i need. However whenever i try that my project freezes and restarts.
For step2, do you have any suggestions on how to send the highest score from my application to post it on facebook, then be able to retrieve it and show it once i get the friend list playing the game?
Thank you
2
Answers
I was able to solve it using threads.
The code before was executing asynchronously there my result wasn't being fetched properly.
Use this GameRequestDialog to load the friends who are non app users.
Along with this, go through this it will provide a great help. It is the sample project of facebook implementations.
https://github.com/fbsamples/android-friend-smash
Hope that helps