fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 998 forks source link

Incoming Notifications not collapsing. #287

Open ghost opened 7 years ago

ghost commented 7 years ago

Hello fellow partners. Im using cordova-plugin-fcm together as firebase Admin (NodeJS) , to send notifications to Android, iOS and Browser. Im not able to use any values besides data and notification because it seems the device is not reading it. This is my payload sent from the Server:

const messageOptions = {
                            contentAvailable: true,
                            priority: 'high',
                            timeToLive: 3,
                            collapse_key : 'demo',
                            data: {
                              event: event
                            },
                            notification: {
                              title: 'some title',
                              body: 'some body',
                              click_action: 'FCM_PLUGIN_ACTIVITY'
                            }
                          };

I manage to get the notification while in background and stuff, but they never collapse under the demo key.

Im using the latest version of the plugin @2.1.1. The only way I've managed to get notifications to collapse was using tag: 'demo' on notification object on the message payload. But that only works for Android and Browser.

Thanks in advance.

ghost commented 7 years ago

Okay, Ive figured it out. collapse_key : 'demo', , is working. If I set my iOs device to "airplane mode", and send 3 notifications with the same collapse_key, as soon I return the internet connection to the device It will only receive one. The problem is when I want to update a notification that already was delivered to the device.

eg. I send a notification saying that the user has a incoming call, if the user doesn't tap the notification I want to update it to "Call Lost". This is possible in Android and Browser by using the tag key in notification object. But I couldn't yet find a solution for iOs

Thanks in advance.

dkarandi commented 7 years ago

@nickmendes Did you find any solution for this? Going through the same issue. I want to avoid switching from fcm plugin as suggested by #291.

ghost commented 7 years ago

@dkarandi

you can't group notifications on iOS with fcm-plugin sadly :(

dkarandi commented 7 years ago

That sucks! Thanks for the quick reply though.

airstep commented 6 years ago

For android part:

  1. https://developer.android.com/training/notify-user/group.html
  2. https://developer.android.com/training/notify-user/expanded.html#inbox-style

need to be integrated