php - Posting a message to a friend's wall using the app access token -
i trying app post friend's wall. tried using fb.api method discovered using has been disabled.
then tried using fb.ui feed dialog discovered message parameter deprecated, , taken out because facebook wanted users enter text. , when user enters text, message never gets posted user's wall.
so after doing alot more research saw option create custom action type. , in doing discovered take approach app needs app access token.
so tried using following means:
fb.api('https://graph.facebook.com/oauth/access_token','get', {client_id:'xxxxxxx', client_secret:'xxxxxxxxxxx', grant_type:'client_credentials'}, function(response) { });
which in no way different in documentation :
get https://graph.facebook.com/oauth/access_token? client_id=your_app_id &client_secret=your_app_secret &grant_type=client_credentials
i errors :
'uncaught referenceerror: xxxxxxxxxxxxxxxxxxxxx not defined' when use
ext.data.jsonp.request({ url : 'https://graph.facebook.com/oauth/access_token', params : { client_id : 'xxxxxxxxxxxxxxxxxxxx', client_secret : 'xxxxxxxxxxxxxxxxxxxxx', grant_type : 'client_credentials' }, success : function(response, opts) { }, failure : function(response, opts) { }
});
or
{type : 'http', message : 'unknown error'} when use
fb.api('https://graph.facebook.com/oauth/access_token','get', {client_id:'xxxxxxx', client_secret:'xxxxxxxxxxx', grant_type:'client_credentials'}, function(response) { });
now documentation says when following :
get https://graph.facebook.com/oauth/access_token? client_id=your_app_id &client_secret=your_app_secret &grant_type=client_credentials
i should following in response object :
access_token=your_app_access_token
now have done appears have followed direction of documentation question why not getting correct output documentation says?
please help.
fb.api
works graph.facebook.com endpoint don't need add graph.facebook.com
explicitly.
i'm not @ computer right i'm thinking call more like
fb.api('oauth/access_token'
though i'm not sure if fb.api accepts plaintext responses, believe designed json responses.
in future check browser dev tools see http doing through js sdk
Comments
Post a Comment