我是关于android编程的新手。我正在尝试将示例代码实现为我的项目link。
当我向我的设备成功向远程服务器发送多个通知时,当新的通知区域出现时,当前通知会从android通知区域消失。多个通知未分组或未单独显示。
我应该专注于解决此问题的位置吗?提前谢谢。
我的服务器php代码如下;
$Message = array
(
'message' => $ArrPushMessage["Message"],
'title' => $ArrPushMessage["Title"],
);
$Fields = array
(
'registration_ids' => $RegistrationIds,
'data' => $Message
);
$Headers = array
(
'Authorization: key=' . GOOGLE_API_ACCESS_KEY,
'Content-Type: application/json'
);
$Curl = curl_init();
curl_setopt( $Curl,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
curl_setopt( $Curl,CURLOPT_POST, true );
curl_setopt( $Curl,CURLOPT_HTTPHEADER, $Headers );
curl_setopt( $Curl,CURLOPT_RETURNTRANSFER, true );
curl_setopt( $Curl,CURLOPT_SSL_VERIFYPEER, false );
curl_setopt( $Curl,CURLOPT_POSTFIELDS, json_encode( $Fields ) );
$GoogleResult = json_decode(curl_exec($Curl),true);
curl_close( $Curl );
服务器结果如下;
Array ( [multicast_id] => 4.9523621355218E+18 [success] => 1 [failure] => 0 [canonical_ids] => 0 [results] => Array ( [0] => Array ( [message_id] => 0:1458493214513473%2d713a4ef9fd7ecd ) ) ) Array ( [multicast_id] => 8.963309427397E+18 [success] => 1 [failure] => 0 [canonical_ids] => 0 [results] => Array ( [0] => Array ( [message_id] => 0:1458493214608687%2d713a4ef9fd7ecd ) ) )