How is the custom_notification payload showing notifications?
See original GitHub issueI am using the custom_notification
payload and the fetch
send method. I have a use case where I want the notification to not be presented if the user is currently in the chat window. Before when I was using a regular data
payload, notifications were presented with FCM.presentLocalNotification
and I would check if the message was read and then if it was I wouldn’t call FCM.presentLocalNotification
.
However now with a custom_notification
payload, FCM.presentLocalNotification
is no longer used to present the notification, and as far I can tell there is no call back to present the notification. Or is there? Any ideas on how I can achieve the above with the custom_notification
payload scenario?
Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
CustomNotification Class | Apex Reference Guide
CustomNotification is used to create, configure, and send custom notifications from Apex code.
Read more >Testing Custom Notification Interfaces - Apple Developer
Test your notification interfaces on watchOS using a notification scheme and payload file.
Read more >How to send a silent Push Notification payload - Stack Overflow
Step 1 : Add custom notification sound file (.wav or .aiff extensions only. e.g. notification.wav) in your app bundle. Step 2 : Configure...
Read more >Custom push payloads | Customer.io Docs
You can send highly customized push notifications using a Custom Payload. If you've integrated with our SDK, custom payloads let you send images...
Read more >Decrypt notification payload before displaying using ... - GitHub
My end goal is to decrypt the message payload and display a custom notification with the decrypted data. Is this possible with ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok I got it working thanks a lot @olieidel for the advice 😃
I set
show_in_foreground: false
for my custom_notification payload on the notification types I wanted to not show in the chat window. Then in thePushController
I checked if it was false within theFCM.on(FCMEvent.Notification
then performed a check to see if theAppState
was active and if the message is read/unread. If unread then I callthis.showLocalNotification
. The notifications in background and killed app states aren’t handled bythis.showLocalNotification
so they are always shown and it Works great!@evollu Just after asking the question, this using same ID trick came to my mind, and I am able to handle it nicely. Thank you for the advice 😃 👍