1

我在我的cordova应用程序中使用pushplugin for android。单条消息没有问题。在应用程序最小化时发送多条消息时,我只看到最后一条通知取代了以前的通知。

我关注了 https://github.com/manjeshpv/PushPlugin/commit/cdd1f56ef7a6a2033a196546cd6b946dc17044ae https://github.com/manjeshpv/PushPlugin/commit/d073ed105aafb1f8793ea3c9a2b5b04e8293f507

这些都不适合我。我也在有效载荷中使用 notId。在我的 php 文件中:

$message = '{"conversation":"'.$message.'", "phoneNumber":"'.$phoneNumber.'", "file":"text", "notId":"'.time().'"}';

几乎没有类似的问题,但问题在那里没有解决。 如何在android中处理多个推送通知

4

2 回答 2

3

Solved myself

$message = '{"conversation":"'.$message.'", phoneNumber":"'.$phoneNumber.'"}';

In php curl:

$field = array( 'registration_ids' => array($registatoin_id), 'data' => array( 'message' => $message, 'title'=>'kwikieText', 'msgcnt'=>'3', 'notId'=>''.time() ), );

notId must be added to 'data' field not the $message variable

于 2015-04-16T16:03:50.957 回答
3

您链接的问题中的答案是错误的。要添加的正确字段是notId(not notificationID) 这将分隔您的通知。

于 2014-12-26T14:24:03.577 回答