0xf104a / NextcloudServices

Android app to send notifications from Nextcloud without using GCM(Google cloud messaging)
GNU General Public License v3.0
63 stars 11 forks source link

Allow users to open chats in Nextcloud Talk rather than Custom tab #54

Closed ColdHotman closed 1 year ago

ColdHotman commented 1 year ago

Hello, and thank you for creating an app that's essential to using Nextcloud Talk without Google Services! Without this, Talk simply isn't a chat application on Android.

The newest update from @freeflyk opens a custom tab to access Nextcloud Talk. Beyond a users personal preference (I'd much rather open the app and navigate to the conversation instead of using the web interface to begin with), this seems to break all notification from Nextcloud Talk for a period of time.

It looks like Nextcloud registers an open chat window and thus don't send any more notifications since the user would already see new messages in their open chat window. It's referenced here: https://github.com/nextcloud/spreed/issues/6096#issuecomment-902479793

That mean any messages sent in the dead zone will never be delivered as notification.

I've tested it with several different browsers (Firefox and Chromium derivatives) and there's always a period of 20 seconds after closing the custom tab before new messages are made into notifications. It's not ideal, but not usage breaking.

Unfortunately if one switches app or just minimizes the custom tab instead of actually closing it - It's registered as running in the background. No notifications are received from Talk at all. I once timed it to more than 3 minutes before NextcloudServices was able to recieve messages again. Another test showed 5+ minutes, still nothing so I force closed the browser. 20 seconds later, notification worked like usual. Posts received in the mean time was "lost" to NextcloudServices, as in there were never any notifications created for them.

When opening the Talk app instead of the browser, there is no delay before being able to receive notifications again. No messages are lost, NextcloudServices is able to get all messages sent. I don't see any downsides with this approach beyond not opening the app inside a conversation. With new conversations always being in the same place, I find this a very minor inconvenience.

As far as I'm experiencing, the update to using WebUI leaves me with two scenarios;

Please allow users an option to open notifications from Nextcloud Talk in the app. I'm sure it works great for some people, but for me it's quite disruptive. I've tried solutions like battery management to force pause the app when not in foreground but it doesn't seem to make any difference.

Thank you for your consideration.

0xf104a commented 1 year ago

Hello. Thankyou very much for such detailed report on this issue! I would implement an additional option in order to make it possible to disable custom tab view.

freeflyk commented 1 year ago

Hello @ColdHotman. Thank you for your information and sorry for the inconvinience. Although I have not observed what you described it makes sense. For me personally I have the issue that I seem not to receive notifications when the talk app is running in the background (which is a different issue though). So I agree with @Andrewerr that an option to whether to use the talk app or the browser should be added in the properties.

0xf104a commented 1 year ago

Tested to work on latest revision of main branch