Open mkinnan opened 7 years ago
It appears I got it figured out on Android thanks to: https://github.com/phonegap/phonegap-plugin-push/issues/1118
I'm using Adobe PhoneGap Build to compile my app with cli-6.3.0 (4.2.0 / 5.2.1 / 4.4.1)
I'm also using this push plugin: https://www.npmjs.com/package/phonegap-plugin-push
In the data
payload, add notId
for the notification ID ... I'm using the node ID so that when two different nodes get created, the first notification doesn't get erased. So, your JSON code going to GCM server would look something like this:
{
"collapse_key":"testing",
"data":{
"title":"My Fun Title!",
"message":"A new event has been added to your group.",
"notId":"1234",
"thepath":"node/1234"
},
"to":"the_token_for_your_test_device"
}
I'm using a modified version of the Drupal.org __push_notifications module in combination with rules__ to create my payload
for sending because I use organic groups.
On my Drupal site, I have the following in push_notifications_gcm_send_message (push_notifications.module) for building the payload:
I get a push notification to my phone with sound. I then use the following in __my_module.js__ in my app:
and it correctly shows me the alert box and directs me to the page in the app. Typically the path is node/123 but may be other non-node pages which is why I send a path and not just a node ID.
I'm trying to implement stacking of messages so they don't overwrite each other if a user is notified of both a new event and a new discussion. I've been following the two links:
https://developers.google.com/cloud-messaging/http-server-ref https://developers.google.com/cloud-messaging/concept-options
So I try to modify things in push_notifications_gcm_send_message to:
I get a notification with sound and get stacking when changing the
tag
parameter when sending multiple notifications ... BUT my_module_push_notifications_receive is not being triggered anymore.What am I doing wrong?