Facebook for mobile applications has been released as an action.
As the documentation says:
To publish a built-in Like action on an Open Graph object,
invoke the following HTTP POST request with a user’s access
token and the url of the Open Graph object.
This Open Graph object can be of any type.
curl -X POST \
-F 'access_token=USER_ACCESS_TOKEN' \
-F 'object=OG_OBJECT_URL' \
https://graph.facebook.com/[User FB ID]/og.likes
Usually, to make a request, for example, for user information, I use this code:
Facebook facebook;
facebook = new Facebook(AppConfig.FACEBOOK_APP_ID);
if (facebook.isSessionValid())
{
JSONObject obj = facebook.request("me");
...
}
else
{
facebook.authorize(...)
{
@Override public void onComplete(Bundle values)
{
String token = facebook.getAccessToken();
long expires = facebook.getAccessExpires();
...
}
}
}
My question is dead, but I can’t find the answer, how can I make the request “graph.facebook.com/[User FB ID] /og.likes” in the JAVA code, as soon as I get the user access token and expires?
source
share