I am at my wits end, I cannot seem to post a message as the page, I can post as the admin user to the facebook page but not to the page as the owner itself.
My code is as follows:
String MY_APP_ID = "xxxx";
String MY_APP_SECRET = "xxxx";
AccessToken accessToken = new DefaultFacebookClient().obtainAppAccessToken(MY_APP_ID, MY_APP_SECRET);
DefaultFacebookClient facebookClient = new DefaultFacebookClient(accessToken.getAccessToken());
FacebookType publishMessageResponse = facebookClient.publish("me/feed", FacebookType.class, Parameter.with("message", fbMessage));
fbMessageID = publishMessageResponse.getId();
I believe the code above obtains an App Access Token, but I am getting the following error:
OAuthException: An active access token must be used to query information about the current user.
I have the following permissions set:
publish_actions, manage_pages, publish_stream
If I modify the code as:
FacebookType publishMessageResponse = facebookClient.publish("MYAPPNAME/feed", FacebookType.class, Parameter.with("message", fbMessage));
I get the following error:
OAuthException: (#200) The user hasn't authorized the application to perform this action.
I've read so much on this but can't see the wood for the trees, can somebody explain where I am going wrong and how I can resolve this nightmare.
Any help would be much appreciated :-)