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.

How is the custom_notification payload showing notifications?

See original GitHub issue

@evollu @seanadkinson

I 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:closed
  • Created 6 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rtmancommented, Sep 5, 2017

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 the PushController I checked if it was false within the FCM.on(FCMEvent.Notification then performed a check to see if the AppState was active and if the message is read/unread. If unread then I call this.showLocalNotification. The notifications in background and killed app states aren’t handled by this.showLocalNotification so they are always shown and it Works great!

0reactions
Louies89commented, Jun 15, 2018

@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 😃 👍

Read more comments on GitHub >

github_iconTop 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 >

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