requesting assistance to understand how to display inbox messages via API. basically, i just want to retrieve the sender and the message in my inbox.
Extended Permissions: read_mailbox
permission is already allowed.
below code works. i just need to know how to properly create a new call
for the inbox messages via JSON format and decode the result.
require '../src/facebook.php';
$facebook = new Facebook(array(
'appId' => 'xxx',
'secret' => 'xxx',
));
// Get User ID
$user = $facebook->getUser();
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$loginUrl = $facebook->getLoginUrl();
}
$getUser= $facebook->api('/me');
echo $getUser['name'];
at first, ive tried adding below.
$getInbox = $facebook->api('/me/inbox');
echo $getInbox['message'];
but it renders error on my PHP.