php - facebook APP api notifications to all user
111
I can send a notification to all user that access my APP, using userid stored in a table "fbuid", and all works fine.
But if an user remove my APP the code fail and nobody get notification. How can I solve this problem.
$app_id = 'AAAAAAAA';
$app_secret = 'BBBBBBBBBBBBBB';
$app_access_token = $app_id . '|' . $app_secret;
$query = pg_query($dbconn, "SELECT * FROM fbuid;");
while ($row = pg_fetch_row($query))
{
$response = $facebook->api( '/'.$row[1].'/notifications', 'POST', array(
'template' => 'Nuovo Annuncio Pubblicato FaiceBuy',
'access_token' => $app_access_token
));
}
Answer
Solution:
That means that the code skips due to exception thrown after failing in 1 case. So, you should write your code in try-catch block, just like this-.