stream-chat-flutter icon indicating copy to clipboard operation
stream-chat-flutter copied to clipboard

Notification in Background : Not Clickable

Open samuel2629 opened this issue 1 year ago • 6 comments

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

Android

What version are you using?

6.8.1

What happened?

When following the steps you're mentioned in order to integrate notifications, if we choose to use data-only mode (for android) when receiving the notification in the background, clicking on it just open the app but never triggers onMessageOpenedApp function. And that is caused by the fact that the data payload doesn't have a click_action tag in his payload.

So the only solution i came up with so far is to use template, but template trigger another issue for my use case, since i'm using the translate functionality, if i use a template, message will always appear to the receiver as they have been sent and not translated as they should.

So i have to choose between delivering the message formatted properly and not being clickable (not triggering onMessageOpenedApp) OR delivering the message not formatted properly but being able to click and trigger the onMessageOpenedApp ?

Thank you

Steps to reproduce

1. Follow steps : https://getstream.io/chat/docs/sdk/flutter/guides/push-notifications/adding_push_notifications_v2/
2. Use without template and try to click on the notification (in background)
3. Use with template and try to format (translate) the message

Supporting info to reproduce

No response

Relevant log output

No response

Flutter analyze output

No response

Flutter doctor output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

samuel2629 avatar Jan 08 '24 14:01 samuel2629

This issue is stale because it has been open for 20 days with no activity.

github-actions[bot] avatar Feb 17 '24 01:02 github-actions[bot]

@samuel2629 did you find a solution to this? Similar issue is in iOS while you are online, you receive push notification even while chatting in the same channel.

aminraeisi avatar Mar 12 '24 19:03 aminraeisi

Hi @aminraeisi,

We are not talking about the same issue, about my issue for anyone asking, i had the team and they admitted that is a scenario not considered so you'll have to choose.

About your case @aminraeisi the doc state that you have to check the channel and filter notification if channel is the current channel, i'm guessing you're using flutter_local_notifications, if so, basically you should check if the notification entering has the same channel id that the current channel and if so not display it.

samuel2629 avatar Mar 14 '24 14:03 samuel2629

@samuel2629 thanks for the answer. We tried that way but some ios users do not get our background (silent) notifications at all. So we switched to the reminder webhook provided by stream which based on that we send a normal push notification to a user if they have an unread message for within 5 mins of the last time they had one.

aminraeisi avatar Mar 14 '24 14:03 aminraeisi

Sorry i don't understand, even with the webhook, notification on the foreground both on Android and IOS are not displayed except if you're implementing a library like flutter_local_notification, no ?

samuel2629 avatar Mar 14 '24 15:03 samuel2629

@samuel2629 yeah but the main issue we had was if we try the stream chat notification that sends a notification for each new message, on ios even while chatting you get the notification and if you use background notification, some users will not receive as Apple does not guarantee the delivery.

aminraeisi avatar Mar 14 '24 18:03 aminraeisi

same +1

anhdo9797 avatar Aug 08 '24 09:08 anhdo9797

Hey @samuel2629, please let me know if this is still an issue.

deven98 avatar Aug 20 '24 13:08 deven98