有没有办法查看设备是否已知对 GCM 服务器空闲?
有没有办法在不使用collapse_key的情况下使用delay_while_idle?
当我在 php 中设置这样的消息时,它确实有效。
$headers = array("Content-Type:" . "application/json", "Authorization:" . "key=" . $key);
$data = array(
'registration_ids' => $deviceRegistrationIds,
'data' => array('message' => $messageText,
'msgfromname' => $fromname,
'close' => $close,
'newchat' => $newchat,
'msgfrom' => $from)
);
当我像这样使用 delay_while_idle 时,它不起作用。
$headers = array("Content-Type:" . "application/json", "Authorization:" . "key=" . $key);
$data = array(
'registration_ids' => $deviceRegistrationIds,
'collapse_key' => $messageText,
'delay_while_idle' => true,
'data' => array('message' => $messageText,
'msgfromname' => $fromname,
'close' => $close,
'newchat' => $newchat,
'msgfrom' => $from)
);
我猜这是因为 $messageText 与数据数组中的某些值具有相同的值?当我将其值更改为“你好”时,它确实有效。