Rejaul
Rejaul

Reputation: 980

How to handle multiple push notification of pushplugin

I'm using pushplugin in my cordova app for android. There is no problem for single message. While sending multiple message when app is minimized, I see only the last notification which replaces the previous notifications.

I followed https://github.com/manjeshpv/PushPlugin/commit/cdd1f56ef7a6a2033a196546cd6b946dc17044ae https://github.com/manjeshpv/PushPlugin/commit/d073ed105aafb1f8793ea3c9a2b5b04e8293f507

None of these working for me. I'm also using notId in payload. In my php file:

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

There would have few similar questions but the problem was not solved there. how to handle multiple push notifications in android

Upvotes: 1

Views: 1718

Answers (2)

Ajoy
Ajoy

Reputation: 1848

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

Upvotes: 3

Jesper We
Jesper We

Reputation: 6087

The answer in your linked question is wrong. The correct field to add is notId (not notificationID) This will separate your notifications.

Upvotes: 3

Related Questions