Reputation: 155
I am trying to add the custom sound in the push notification. I have added the showNotification in the background handler on the client-side (flutter), but now when the application is in the background or terminated I receive duplicate notifications, one with default sound and the other with my custom sound. Can anyone tell me how to stop showing the default background notification?
Upvotes: 3
Views: 4679
Reputation: 7696
You're getting the duplicate notification because
notification message
and it is automatically displayed by the FCM SDK and,The solution is to send a data message
instead of a notification message
.
With FCM, you can send two types of messages to clients:
- Notification messages, sometimes thought of as "display messages." These are handled by the FCM SDK automatically.
- Data messages, which are handled by the client app.
Upvotes: 9