humhub / app

18 stars 7 forks source link

Notification Count 131 #121

Closed felixhahnweilheim closed 8 months ago

felixhahnweilheim commented 8 months ago

When I get 1 push notification, the app count shows 131 instead of 1. (When I open the app, only 1 notification is shown.)

(Apart from that the notifications work fine.)

Screenshot_20231015_091227_One UI Home.jpg

app version 1.0.77

Android 13

luke- commented 8 months ago

Hmm, I cannot reproduce this.

Steps:


Btw. we'll plan to sync the HumHub notification count with the App Notification count in the next release: https://github.com/humhub/app/issues/52

felixhahnweilheim commented 8 months ago

Hi, I have now also tested with community.humhub.com (luckily someone commented a post, so I got a push notification). But the notification badge shows again 131.

I have downloaded the app from the Github release (arm64-v8a) version 1.0.77

Android 13

One-UI version 5.1

Samsung Galaxy A51 anything else that could be relevant?

But if you rework the notification count anyway, we can wait for this and I test again with next release.

luke- commented 8 months ago

@PrimozRatej Any idea?

PrimozRatej commented 8 months ago

I checked it the badge count is set only in 2 cases. 1. The user gets a push notification that contains the badge count. 2. updateNotificationCount Js channel is triggered on the web app, and the count is sent over the JS channel. @felixhahnweilheim Is it possible you have 131 unread notifications?

felixhahnweilheim commented 8 months ago

I tested with 2 of my installations and also community.humhub.com, always the same number: 131

Now I went again to the debug page of the FCM module and tried out "Test notification count". The new number is shown correctly when there is an unread push notification.

After trying that a few times I removed the unread Android notification and tested again. Now the notification badge shows 1. :-)

So I guess the number 131 was just left over from "Test notification count". (It seems I already used it earlier.)

But the strange thing is that the count remained even when changing the HumHub instance. I think it should be set to 0 when exiting an instance.

And maybe the FCM Debug page should also have the option to set the count to 0?

PrimozRatej commented 8 months ago

Yes, I agree the count should reset when the user exits the instance and set to new value when the user logs in to another instance, in the way that updateNotificationCount is called.

PrimozRatej commented 8 months ago

Hey, @luke- I changed the updateNotificationCount functionality, so that when the user logs out of the instance we set it to 0 (badge disappears), now on the web side we would need to call the updateNotificationCount JS channel when the user logs in and pass in the number of the current notification count.