question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question - How to replace multiple notifications with a single one?

See original GitHub issue

Hi,

Many thanks for working on such a great framework! I’ve managed to get react-native-fcm working (react-native version 0.48.4) with remote notifications, both on iOS and Android devices (versions from iOS 9-11, Android 5-8), when the app is in foreground, background and not-running.

Sometimes it turns out I send multiple notifications to the user before they check them. And I was wondering if it’s possible to replace multiple notifications with a single one, saying that there’s multiple updates? This would ideally work in background, when the app is not running, and when it’s been killed by the user (is that the same as not running?).

This is the format of the remote notifications I’m sending:

iOS:

{
            title: title,                     
            body: body,                    
            sound: "default",                                   
            priority: "high",
            show_in_foreground: showinfg   
}

Android:

{
            "custom_notification": {
                "body": body,
                "title": title,
                "icon":"ic_notif",
                "priority":"high",
                "sound":"default",
                "show_in_foreground": showinfg
                }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
evollucommented, Oct 9, 2017

or you can pass same id property, it should override the old one

0reactions
tss101commented, Oct 9, 2017

many thanks will give it a try

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Multiple notifications instead of one - Stack Overflow
After execute this code multiple notifications show up. All are duplicates. I tried to change pending intent flag, but I got no satisfactory ......
Read more >
Two notifications attached to single work order - SAP Community
It's perfectly possible to create an Order for multiple Notifications, although only one Notification can be assigned to the Order header. The ...
Read more >
Solved: Multiple notifications - Canvas Community
Turn off notifications at the device level (in the settings) for a few minutes and then turn them back on; Turn off all...
Read more >
Use notifications on your iPhone or iPad - Apple Support
Tap a single notification to open the app that it's from. Tap a group of notifications to view all recent notifications from that...
Read more >
Modify Google Calendar notifications - Computer
... you can get notifications on your phone, computer, or by email. You can change your notification settings for one event or multiple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found