Facebook login by sdk but post issue

2019-08-13 03:02发布

问题:

This is what my logcat shows as a response

{
 Response:  responseCode: 403, 
 graphObject: null, 
 error: {
     HttpStatus: 403, 
     errorCode: 200, 
     errorType: OAuthException, 
     errorMessage: (#200) The user hasn't authorized the application to perform this action
  }, 
 isFromCache:false
}

I'm unable to post to facebook due to this error. What are the steps to authorize the application?

回答1:

I guess you need to issue an HTTP POST to that endpoint to publish a new feed story, facebook provides the "method=post" GET parameter to "fake" a post, this might work for you.

https://graph.facebook.com/USER_ID/feed?access_token=TOKEN&message=HelloFacebook&method=post

w.r.t to response you will get an id as :

{
   "id": "499801468_1001264776039"
}

for more details please refer

for GraphAPI - http://developers.facebook.com/docs/reference/api/#publishing

Also please check your permission tag