Hello Everyone,
I'm trying to execute this code in Facebook developer
upload.php
<?php
require_once('php-sdk/facebook.php');
$config = array(
'appId' => 'appId',
'secret' => 'secret',
'fileUpload' => true,
'allowSignedRequest' => false
);
$facebook = new Facebook($config);
$user_id = $facebook->getUser();
$photo = 'facebook_logo.jpg';
$message = 'Photo upload via the PHP SDK!';
?>
<html>
<head></head>
<body>
<?php
if($user_id) {
try {
$ret_obj = $facebook->api('/me/photos', 'POST', array(
'source' => $photo,
'message' => $message,
)
);
echo 'Photo ID: ' . $ret_obj['id'];
echo '<a href="' . $facebook->getLogoutUrl() . '">logout</a>';
} catch(FacebookApiException $e) {
$login_url = $facebook->getLoginUrl( array(
'scope' => 'photo_upload'
));
echo 'Please <a href="' . $login_url . '">login.</a>';
error_log($e->getType());
error_log($e->getMessage());
}
} else {
$login_url = $facebook->getLoginUrl( array( 'scope' => 'photo_upload') );
echo 'Please <a href="' . $login_url . '">login.</a>';
}
?>
When I clicked login (in facebook)
Error
App Not Setup: The developers of this app have not set up this app properly for Facebook Login.
I already try getting the code for getting user info and posting a link posted in Facebook developer and it works fine.
In my
Facebook Developer Settings
App on Facebook
Canvas URL:
http://localhost/sites/folder/
Canvas URL:
https://localhost/sites/folder/
Website
Site URL:
http://localhost/sites/folder/
And what does this means
To upload a photo to a user's wall, we need photo_upload permission
Can't find this in Settings.. Don't know if this permission is in Users Profile, If so where can i find it?