1
我想從我的應用程序發送批次通知,幾個應用程序用戶發送批量應用通知乳寧下面的代碼,我得到的響應錯誤後:無法使用Facebook PHP SDK
"{"error":{"message":"(#100) Must specify a non-empty template `param","type":"OAuthException","code":100}}"`
雖然模板參數是設置...
欣賞什麼我做錯了任何幫助..
這裏是我的代碼使用方法:
$batched_request = array();
foreach ($users as $idx => $user) {
$request = array(
'method' => 'POST',
'relative_url' => '/' . $user['id'].'/notifications',
'access_token' => $app_access_token,
'template' => $template,
'href' => $href
);
$batched_request[] = json_encode($request);
}
$params = array('batch' => '[' . implode(',',$batched_request) . ']');
try {
$response = $facebook->api('/','POST',$params);
} catch(FacebookApiException $e) {
error_log($e);
}