2014-12-17 2 views
2

Android 용 내 cordova 앱에서 pushplugin을 사용하고 있습니다. 단일 메시지에는 아무런 문제가 없습니다. 앱이 최소화 될 때 여러 개의 메시지를 보내는 동안 이전 알림을 대체하는 마지막 알림 만 표시됩니다. pushplugin의 다중 푸시 알림을 처리하는 방법

은 나를 위해 일하는 이들의 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().'"}'; 

비슷한 질문은 있지만 문제는 해결되지 않았습니다. how to handle multiple push notifications in android

+0

변수가 아닌 $ 메시지에 추가해야합니까? 여기에 코드를 공유하십시오 –

+0

해결되었습니다. $ message = '{대화': ''. $ 메시지. ' ","phoneNumber ":"'. $ phoneNumber. ' "}' '; PHP의 컬 : $ 필드 = 배열 ​​( 'registration_ids'=> 배열의 ($ registatoin_id) '데이터'=> 어레이 ('메시지'=> $ 메시지 '제목'=> 'kwikieText' 'msgcnt'=> '3', 'notId'=> ''. 시간()), ); ''notId ''는'$ message' 변수가 아닌 'data'필드에 추가되어야합니다. – Rejaul

+0

답변을 추가하고 해결 된 것으로 표시해야합니다. – Ajoy

답변

2

연결된 질문의 답변이 잘못되었습니다. 추가 할 올바른 필드는 notId (notificationID 아님) 알림을 분리합니다.

3

는 PHP 컬에서 자신

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

에게 해결 :

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

notId 당신이 한 일을 '데이터'필드

관련 문제