This code gives me a short-lived Access Token -
AccessToken ac = AccessToken.getCurrentAccessToken();
From Facebook documentation, I found out the Graph Request endpoint to exchange a short-lived access token for a long-lived one -
https://graph.facebook.com/oauth/access_token?
client_id=APP_ID&
client_secret=APP_SECRET&
grant_type=fb_exchange_token&
fb_exchange_token=EXISTING_ACCESS_TOKEN
On using this on the Facebook Graph API explorer, it is giving me a JSON like this -
{
"og_object": {
"id": "xxxx027724271xxxx",
"type": "website",
"updated_time": "2015-08-13T21:32:57+0000",
"url": "https://graph.facebook.com/oauth/access_token"
},
"share": {
"comment_count": 1,
"share_count": 100
},
"id": "https://graph.facebook.com/oauth/access_token"
}
But how do I get the new long-lived access token ?