I thought it is easy thing to do, but seems that it is not. I have an Android app. User logs in into this App, using Facebook. I also have a Facebook page (besides Facebook app). So, I want to create an event on behalf of my page from my android app. Here is what I do:
Bundle params = new Bundle();
params.putString("name", "name");
params.putString("description", "descr");
params.putString("location", "loc");
params.putString("start_time", "properly_formatted_time");
new Request(
Session.getActiveSession(),
"/" + PAGE_ID + "/events?access_token=" + PAGE_ACCESS_TOKEN,
params,
HttpMethod.POST,
new Request.Callback() {
public void onCompleted(Response response) {
}
).executeAsync();
I have generated long living token with all required permissions as described here: Long-lasting FB access-token for server to pull FB page info
If I try to create event, being logged in as myself (admin of a FB page and application), it works fine.
When I am using someone's account, who is not an admin, I am receiving following error:
{HttpStatus: 500, errorCode: 1373019, errorType: Exception, errorMessage: You must be an admin of the specified page to perform the requested action.}
So, how it is possible to fix this. I've googled around and found some similar questions, like How to post to a Facebook Page (how to get page access token + user access token), but those either have no correct answer, or are using "me/account"
and then get access_token, which is not something I want to do.
Any help would be greatly appreciated.