-
-
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
UnifiedPush for push notifications #8684
Comments
Another option, not sure if it would be more or less work to implement (for both users and nextcloud developers) is to use a persistent notification. Apps like K-9 and Telegram FOSS use this approach. But definitely not providing notifications at all for the app distributed via f-droid is too disruptive, and probably the user should be notified when the app is first run (I recently moved to use the f-droid version and didn't notice after a few days that I lost all my notifications, I think for now I will sadly need to go back to Google Play). |
I assume by this you mean, use a persistent notification to remain running in the background and keep a connection open to the server? This is a bad idea IMO. It takes a lot of work and is very tricky to do this in a battery-efficient way. It also doesn't really scale to all apps on the device doing this. You really want a central push provider to keep a connection open because that minimizes how much you have to wake up the radio. |
A Nextcloud app called Push Notifier has quietly appeared for push notifications on Android. See discussion thread and project gitlab repo. |
That's good idea. In principle. But it is not that good, as it sounds. Googles Push-Service helps to save energy. Only the Notification-push-Receiver has to be active on the phone, and not all the apps too. No wakeups and so on... If every App brings it's own push-notification-receiver, i can run all apps instead too... So please integrate nextcloud notifications into unifiedpush. |
Should be a cascade: Is FCM present? Use FCM. If not... OR Just make it a user setting:
|
There is: |
Just out of curiosity, why hasn't there been a further push on this (no pun intended)? One of the main reasons many people move to Nextcloud is to get away from the cloud providers like Google... So it makes sense to completely de-google Nextcloud by implementing UnifiedPush. I almost feel that for the sake of privacy and those who are trying to have phones that are completely de-googled, this would be a huge plus. At this time, Nextcloud is literally the only reason I have to have MicroG installed on my android phone (have tried the notification service provided in f-droid, but it doesn't really allow for the same level of usefulness as normal notifications do). |
My understanding is nc offers their own unifiedpush server. See
https://apps.nextcloud.com/apps/uppush
…On Tue, Jul 26, 2022, 8:57 AM bugbountyguy ***@***.***> wrote:
Just out of curiosity, why hasn't there been a further push on this? One
of the main reasons many people move to Nextcloud is to get away from the
cloud providers like Google... So it makes sense to completely de-google
Nextcloud by implementing UnifiedPush. I almost feel that for the sake of
privacy and those who are trying to have phones that are completely
de-googled, this would be a huge plus. At this time, Nextcloud is literally
the only reason I have to have MicroG installed on my android phone (have
tried the notification service provided in f-droid, but it doesn't really
allow for the same level of usefulness as normal notifications do).
—
Reply to this email directly, view it on GitHub
<#8684 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANUKZSFDYEE7SY2LY4M2TTVWADEXANCNFSM5AED5YIQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@sunjam ah, I think I misunderstood that that app required a different custom nextcloud installation that worked with that. I didn't realize it was an actual nextcloud app that can be integrated into the existing server. I'll check this out later and see if it works with the apps (In particular, NC Talk, News, and Deck) on my device. Thanks |
Just to share an update on this - doesn't look like UP-NextPush works with the nextcloud apps. Not sure if I just configured the phone app wrong or what (looked like it was simply just logging into it and that's it). It shows two dialogues - one that seems to show it's connected, but also one that says "disconnected". Server sees the phone as being connected, but yeah. Installed the f-droid version of NC Talk and such, and no notifications when testing it out, so had to go back to the google play versions. Edit:
So sounds like since I am not willing to make my NC server internet-facing, this isn't going to be an option for me even if the apps worked with UP? 🤔 Or is the real translation that "as long as your device has access to the NC server"? Because that's (obviously) true for me. |
I think you messed some things up ;) The UnifiedPush Nextcloud App for the server is a user-choosen distributor. So if you install this app to your server and install their distributor app, you can use it to receive notifications for third-party apps which support UnifiedPush (like Element or SchildiChat). Hence it is a (drop-in) replacement for Gotify-UP. The Nextcloud Android app still needs to become a UnifiedPush supporting app so its notifications can be received using any UnifiedPush provider. That's why UnifiedPush is great, it lets use choose the server we want to trust to deliver our notifications. See this chart for clarification (or read more on https://unifiedpush.org/): |
If an Android dev needs more inspiration on how to implement support for UnifiedPush, here is the PR which implemented it into Element. They use library which is a kind of drop-in replacement for Google's FCM library. The library will favor UnifiedPush if the user has installed it (it can be expected that a user which has a UnifiedPush provider installed might want to use it), but can fallback to using FCM directly. However, the server may also needs an adaption as it needs to allow the Android app to submit any URL, which the server then should send its push notifications to. |
I also request unified push support. Having now Tusky and Synapse/Element supporting UnifiedPush, having this for Nextcloud would be highly appreciated. Running my own ntfy server. Works really well. Setting the unified push server address would be best on a per user base, where the client retrieves a default from the Nextcloud server but the user can change it to another one. The Nextcloud server though needs to push messages based on the user's choice to the UnifiedPush server by the user. This way any user can choose its own unified push server and that's what is expected (having only one push connection per Android device). |
For clarification about UnifiedPush: UP requires the app server (here Nextcloud) to support "any" UP server and the server cannot propose a default server for UP. It's up to the user (by installing an UP distributor app) or the OS (by integrating it preinstalled, like Google does) to select & provide the required information about the "UP server" (if any is required, see here). If an app wants to enable UP, following happens (assuming ntfy is used as the distributor):
The best practice would then be that the UP endpoint is stored per client (not per user) as multiple clients can (and most probably will) use different endpoints (maybe even different services). Like stated above, the endpoint address may be handled like the FCM token. And that the user cannot configure the UP endpoint via the UI but will be generated by the UP distributor app (ntfy) and set by the Nextcloud app in the background. |
+1 for unified push support for nextcloud client apps |
Hey @crashbandicode! Please don't add +1 comments, as they don't contribute anything to the discussion and just generate more email for the maintainers (and those who are subscribed to this issue) to go through. Instead, you can support issues by using GitHub's reactions feature (smiley icon at the top-right of each comment). Alternately, if this feature is important to you, you could contribute a patch yourself. |
I have submitted some pull requests that don't change architecture to achieve nextcloud notifications to be sent via the 3rd party unified push app. see; nextcloud/server#47763 and nextcloud/notifications#2027 ... also a pull request for the 3rd party unified push app that can be applied after the pull requests above are applied; https://codeberg.org/NextPush/uppush/pulls/17 i have also submitted pr's for the generic (f-droid) android nextcloud client and talk apps to use the nextcloud server changes and these changes to create an end-to-end solution for unified push notifications and talk; |
@gavine99 when your PRs are merged, will we be able to use ntfy.sh self hosted servers besides UP? |
@returntrip i posted and ghosted my PRs because I had to move onto other things. I hope someone else might shepherd them through merge to mainline. My PRs for android apps use the UP android connector library (https://codeberg.org/UnifiedPush/android-connector) so should work with any android UP distributor like the ntfy one - https://unifiedpush.org/users/distributors/ntfy/ My PR for the UPPush server plugin - https://codeberg.org/NextPush/uppush/pulls/17 - hasn't been accepted and I got tired of merging my changes locally through a couple of recent updates, so I whipped up a separate nextcloud plugin that bridges nextcloud notifications and the UPPush plugin without any changes to the UPPush plugin - https://github.com/gavine99/uppush-notifications. I've been running my set of PRs on my nextcloud instance and grapheneos device since september and they've worked reliably. It's real, real sweet to have google-free nextcloud and talk notifications! ps. If anyone picks up my android app PRs; fyi I had to add a short wakelock in the android apps as soon as each UP message is received to wake the device enough to perform the background work job to show the notifications, else call and message notifications were delayed when the device was dozing. I don't think I updated the PRs with that change but it's only one or two lines of code so anyone can easily add them if they want. |
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
If every FOSS app that needs to push notifications implement their own push notification system, battery will drain faster because every app will have to check every x seconds, even if when optimizing the process.
I propose that NC uses the UnifiedPush project https://unifiedpush.org/ which is being actively developed and is working properly. It also allows the use of FCM, so both worlds and there's a push provider for it (Gotify-UP) available at F-Droid .
The design flow would be something like:
Describe alternatives you've considered
Use Micro-G not sure if it supports FCM implementation but even that, metadata about notification are still sent via Google
Additional context
UnifiedPush currently supports the open source push provider Gotify-UP available on F-Droid and Google FCM. It's being used by IM apps like FluffyChat and others are working on it like Element.
The text was updated successfully, but these errors were encountered: