-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[User Still Receive Push Notification When Online] #57
Comments
Hi Riandy, I think the comment in the code is incorrect but the code itself is correct. The code you pointed out collects device IDs which later are excluded. Take a look here https://github.com/tinode/chat/blob/devel/push_fcm/push_fcm.go#L73-L80 |
Yes, I’m aware of that. Hehe… If we take a look at this block, we will see that the topic only exclude device ids which session is attached to that topic. So for example, if user A is online by subscribing to So in the end, user A would receive both This is the problem which I’m trying to address. |
Correct, the user will receive both {pres} and push. But I think that's the desired behavior. Is it not? I just checked Telegram and WhatsApp and both of them behaved in this exact way. It seems logical. What am I missing? |
Lol..🤣 Yeah, you’re right, Gene. I just checked it too. Whatsapp also have the same behavior. I was under impression that push message should only be used when socket connection is not established between client & server. So I thought when user online, the server should not send push message towards the client. But after observing Whatsapp, it is much better with this behavior. Because user become more aware that there is new message incoming 👍 . Thanks a lot, Gene. Sorry to bother you. Lol. |
Hello, Gene
I found that in current push implementation, if a user doesn’t subscribe to topic, even though he is online, he will still receive push notification when there is new message on the topic.
You could see the details here, which shown topic only exclude device ids which subscribed to current topic.
I think this behavior will annoys user though. Because even though user is already online in app he would still receive notification.
What do you think?
Thanks
The text was updated successfully, but these errors were encountered: