0
有一個在我的Android應用程序通知.....但我看不到我的設備上的任何通知... 繼承人我的代碼...對設備沒有通知,但沒有在應用程序通知-Android推送通知
function androidnotify($deviceToken,$message,$app,$badge,$alerttype,$xyzid)
{
$apiKey = ".........";
$url = 'https://android.googleapis.com/gcm/send';
$regid[]=$deviceToken;
$registrationIDs = $regid;
$fields = array('registration_ids'=> $registrationIDs,
'data' => $message,
'badge'=> $badge,
'alerttype'=> $alerttype,
'xyzid' => $xyzid);
$headers = array('Authorization: key=' . $apiKey,
'Content-Type: application/json');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
$result = curl_exec($ch);
}
我的設備需要太多的通知...我應該怎麼辦....