Alright, here's what I'm facing:
I have made an app for my facebook fan page, my app is a Facebook Page Tab app.
I have added the application to my facebook page by following:
http://developers.facebook.com/docs/appsonfacebook/pagetabs/
respectively, entering:
http://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL
and choosing which page to be added to.
When I have done this I did it with my Facebook Page Admin user.
I have allowed manage_pages and publish_stream and publish_actions permissions.
Here is my code:
$objFacebook = App_Utils_Facebook::getFacebook();
$user_id = $objFacebook->getUser();
$objFacebook->setFileUploadSupport(true);
if(isset($_REQUEST['pageId'])){
$arrPriv = $objFacebook->api("/".$_REQUEST['pageId']."/", array('fields'=>'access_token'));
$link = 'http://link/here/'.$this->objAnunt->id;
}
$privacy = json_encode(array('value'=>'SELF'));
if(isset($arrPriv['access_token'])){
$access_token = $arrPriv['access_token'];
}else{
$access_token = $objFacebook->api("/".$_REQUEST['pageId']."/", array('fields'=>'access_token'));
}
if($user_id){
try{
$ret=$objFacebook->api("/".$arrPriv['id']."/photos",'POST',array(
'source'=>'@link/to/pic.jpg',
'message'=>$strTitle.'
For more details click here '.$link,
'access_token'=>$access_token,
'privacy'=>$privacy
)
);
unlink('link/to/pic.jpg');
}catch(FacebookApiException $e) {
echo $e;
}
}else{
$permissions = $objFacebook->api("/me/permissions");
if( !array_key_exists('publish_stream', $permissions['data'][0]) ||
!array_key_exists('manage_pages', $permissions['data'][0])) {
// We don't have one of the permissions
// Alert the admin or ask for the permission!
header( "Location: " . $objFacebook->getLoginUrl(array("scope" => "publish_stream, manage_pages")) );
}
}
So I repeat myself, I want to allow the average user to access my application and THE PAGE ITSELF to post on it's own wall.
Can I do it? If not are there any alternatives.
Thank you for your time and patience to help me figure this out!