Open marc-farre opened 1 year ago
@marc-farre Just tested different scenarios and it works well on my side. Can you please test it again with latest app version?
@luke- tested again with app version 1.0.76 and I still have the same problem (with https://community.humhub.com all is OK).
Is it normal that, each time I refresh the page on https://push.humhub.com/, the API Keys are different?
Is there a debugger I can look at to check what's happening?
@marc-farre Yes, it's normal when the API Keys change. (JWT Token).
What is the URL of the sending instance? d***.cuzy.app
?
/fcm-push/mobile-app
Thanks @luke- for your help. Indeed, I forgot this hidden debug page. Very usefull!
But wow, something has changed... App notifications work again! And when I quit the app and open it again, I don't see the Humhub instance URL form, I'm directly on the home page.
Strangely, I still have "App Detection - Current Request: NO App Request Detected" in the debug page. But it works well.
I didn't do anything to make it work, tests are done exactly the same way, and the app has not been reinstalled. It's like if the "Test notification on the debug page" made it work!
I've configured another Humhub instance and tested, it works well too. So I'll close this issue and reopen it if I see something else wrong.
@marc-farre The message App Detection - Current Request: NO App Request Detected
should only appear, when the debug page is accessed via a normal Browser.
If you access the Debug page via the mobile app, this message should not appear.
I reopen the issue because I'm still having randomly the issue.
I have the green "App Detection - Current Request: Is App Request". Everything seams to be well configured and push notifications are well received on the browser.
But on the mobile app, sometimes it works, sometimes not. Tested with 3 different instances. I've also removed the mobile app data and reinstalled the app.
Maybe I should move this issue to the mobile app repository as the Firebase push service works well for the browser?
@marc-farre Hmm, we can check whether the notification arrives at our push service. Can you send me a registered push device ID (debug page, first 6 characters) and URL of a missing notification as a private message. Then I'll check whether it was forwarded.
@luke- Thank for your investigation proposal. Now I understand better what's happening:
I've tested on 4 different instances. All of them are on the latest stable versions (core and push module) and on the same server. All is green in Prerequisites and I've done everything described here: https://community.humhub.com/s/installation-and-setup/wiki/Mobile+app+%26+Push+notifications I have the green "App Detection - Current Request: Is App Request" and browser push notifications works well on all 4 instances.
But:
On instance 1, I had 3 registered push devices. I've deleted them, came back on the instance in the mobile app, and a new one is created. Then mobile app notifications worded again. Each time I change instance in the mobile app, a registered push device ID is deleted (when I'm in another instance) and recreated (when I come back to it). So this is perfect, it works well now. But I don't know why I had 3 registered push devices and why I had to manually delete them.
On instances 2, 3 and 4, I nether get any registered push device. Even if I "Send registerFcmDevice
message":
@marc-farre
On instance 1, I had 3 registered push devices. I've deleted them, came back on the instance in the mobile app, and a new one is created. Then mobile app notifications worded again. Each time I change instance in the mobile app, a registered push device ID is deleted (when I'm in another instance) and recreated (when I come back to it). So this is perfect, it works well now. But I don't know why I had 3 registered push devices and why I had to manually delete them.
Please note that a browser also counts as an extra push device. Could this explain the 3 devices?
On instances 2, 3 and 4, I nether get any registered push device. Even if I "Send
registerFcmDevice
message":
So you never received push messages from these instances? Not even on the browser?
Please note that a browser also counts as an extra push device. Could this explain the 3 devices?
I see. I've done some tests, and it appears that:
So you never received push messages from these instances? Not even on the browser?
I receive notifications on the desktop computer browser:
But I don't receive notification neither on the mobile app, nor on a browser of the mobile phone.
In summary:
@marc-farre There may be a mix-up here between normal browser notifications and browser push notifications.
Only when HumHub tab is open. Work without "push", it's triggered by the HumHub live
component, which per default uses polling.
I only receive browser push notifications when the browser tab is not active, e.g. even when it is closed. But here registered DeviceID is necessary in the Push Notification Debug Page.
When I click "Reset Permission", the browser asks me again, whether notifications should be sent.
Following message should appear in the console:
And a new new "Registered FireBase Device" should appear on the Debug Page.
Note: This works only, when Firebase is configured manually. Our "Push Service" doesn't send Browser Push notifications.
When a user logs in via the mobile app for the first time, a new device should be displayed on the mobile app debug page. When logging out, this device should be removed again.
Note: The Browser Push Service must be configured.
If it's not working, maybe Notifications are blocked in the Android App Settings?
@luke- Thanks very much for your time and the explanations. I've took the opportunity to fill up this doc page: https://github.com/humhub/documentation/pull/90/files
So now I understand what was the problem with the "Desktop Browser". It was due to Brave which disable by default Google Services for push messaging: https://stackoverflow.com/a/69624651
Today, notifications on mobile app works on the 3 other instances (I did no change...) and I can see them on the Registered FireBase Devices... I still don't understand why it works intermittently. Next time I have the problem again, I'll try to understand. Maybe something to due with https://github.com/humhub/app/issues/139
FYI (I don't know if it's a problem):
@marc-farre [...]
Today, notifications on mobile app works on the 3 other instances (I did no change...) and I can see them on the Registered FireBase Devices... I still don't understand why it works intermittently. Next time I have the problem again, I'll try to understand. Maybe something to due with humhub/app#139
Let me know, when the problem occur again.
FYI (I don't know if it's a problem):
- On the browser, if I reset permission and block notifications, or if I logout, the Registered FireBase Device is not deleted.
- With the mobile app, it's well deleted after logging out
I've created a issue here: https://github.com/humhub/fcm-push/issues/32
Let me know, when the problem occur again.
Test today:
So for this test, I've lost the FireBase Device registration after a while (I logged in a few days ago). I'll do more tests in the days to come.
@luke- This issue is I think the major problem we have to use the mobile app. I've asked people to test the app, and I'm often facing these problems:
When I have multiple registered devices such as Is there a way to know which one is the mobile app?
@marc-farre Tokens with the sender id 21392898126
should belong to the HumHub Proxy Service (Mobile App).
Do your tests also show that the push notifications stop working after a while?
@luke- Thanks.
push notifications stop working after a while
I don't have the problem anymore. Now, "Registered FireBase Devices" seams to be persistant, but I'm doing too few tests to answer well (based on 2 Humhub instances since one week).
If it was possible to display in the "Registered FireBase Devices" list which one is for the mobile app it could help understanding what's going on, because it's quite difficult to understand what's causing the problems with these "Registered FireBase Devices". I cannot found a way to reproduce them.
It was working before (I cannot tell which version, but with 2.0.0-beta), but on version 2.0.0-beta.9 (and perhaps before), the Push Service is not working on the Android mobile app version 1.0.75 and Android 11.
Step to reproduce the problem:
With https://community.humhub.com/ you are still into the Humhub instance. With another Humhub instance, the app displays the Humhub instance URL field. Once entered, you are already logged in (the app kept the cookies).
Other symptom: push notifications works with the app for https://community.humhub.com/ but not for another Humhub instance.
The tested instance:
But I don't know if that's normal, each time I refresh the page on https://push.humhub.com/ the API Keys are different.