-
Notifications
You must be signed in to change notification settings - Fork 67
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
Push notification #219
Comments
Would like to see notifications work on degoogled devices. |
This seems quite similar to #125 |
Agreed. This would require backend support from lemmy -- there is an open issue for this. |
Hey all! An experimental version of notifications (for Android) is being worked on in #1000! It works completely without a notification server by having Thunder make a periodic poll. Unfortunately this won't work on iOS and has various limitations depending on Android manufacturer, but it appears like the solutions mentioned in LemmyNet/lemmy#2631 have similar issues, so this is at least a start on our part. 😊 |
I think it would still be a very good idea to have unified push supported. It isn't only push notifications that it adds. It also synchronizes the polling of all apps that supports it (this enables the device to remain sleeping for longer without being interrupted), and it supports the transition away from proprietary services like Google's, and Apple's push notifications. |
It is explained well in the documentation (or, at least, far better than I could summarize 😜 ).
It is not necessary, but it is possible.
A dedicated app (e.g. Ntfy) is responsible for retrieving notifications. This single source is where the potential gains in battery life arises. P.S. For more information, there exists a decently long thread with input from the devs. |
UnifiedPush is designed to be used with self-hosted servers, but it can also be used with third-party servers. With https://ntfy.rollenspiel.monster we offer such a service.
See @K4LCIFER answer |
Thanks both for the explanations! One more question: what would be the ask of Thunder devs here?
Also does any of this provide benefit for iOS? Because that's really where #1000 is lacking. Sorry for all the questions, I'm just trying to wrap my head around what this would look like if we supported it! |
I am not really sure, which is why I am asking these questions, and trying to nail down exactly what would be asked of us from the Thunder side of things. Pardon my ignorance! 😊
Yes, I would want to tap on the notification to show the message it in Thunder, and maybe even have quick actions for Mark as Read, etc. Do you know if Ntfy always handles these actions, or whether it's possible to trigger an action in another app?
You should check out the video recording in #1000 and see if it's what you had in mind! It's local notifications, not based on UnifiedPush, but it sounds like what you might want. 😊 |
I'm not too familiar myself with UnifiedPush, but from a quick look, I was not able to find information on how this would work on iOS devices. It seems to mainly be targeting Android devices so there will most likely be two separate implementations for the different platforms (Android/iOS). This being said, I'm completely open to having UnifiedPush as a solution for Android devices, along with what is being implemented at the moment with local notifications. Like @micahmo, I'm not too familiar with how it works but it does seem like there is a package which might help simplify our implementation with UnifiedPush: https://pub.dev/packages/unifiedpush For now, this is what I'm envisioning: Android:
iOS:
|
Yes, the function looks the way I imagine it.
Yes that is possible, element, fluffychat and also a few mastodon apps support UnifiedPush and the actions you describe there are possible. This is currently not possible on iOS, let's see what happens if apple now has to allow more stores, then this could also work in the future. |
The notification appears on your device as if it originated from the end user application -- the push distributor (e.g. Ntfy) forwards them to the end-user application.
This is where my knowledge of the protocol is a bit lacking (and, in all honesty, so is the official Unified Push documentation) -- I'm not entirely sure what is required of the Lemmy servers.
It is not compatible with iOS, as iOS does not allow applications to run in the background. The distributor app must be able to run in the background in order to fetch notifications. From UnifiedPush's FAQ:
As far as I am aware, the notification is always displayed on the device as if it had originated from the end-user application rather than the distributor app. |
From what I understand, the UnifiedPush app on your phone simply gets a message from the UnifiedPush server that a certain app has a new notification and it then wakes that app up and tells it to poll for new notifications. I'm not 100% sure that that's how it works but it makes sense since the notifications aren't coming from the UnifiedPush app but from the actual app that got that notification. Also, there's apps like Moshidon for Mastodon or Molly for Singal that support UnifiedPush, even though it's not supported on the server side. What they do is, they use a server (or rather, a simple container) that periodically checks the server (in this case, the Mastodon instance or the Signal server) for new notifications via the API and if there are any, it tells the UnifiedPush server, which then tells the UnifiedPush app on the phone. In Molly you have to set that server up yourself while Moshidon provides one for everyone to use. |
This is pretty on-point! The one correction here is that the UnifiedPush server can send a payload which the app can then use to figure out the rest (e.g., retrieve the specific notification, open up a specific page, etc)
This is what we're essentially working on with push notification support. This is still very much a WIP but there's a repo that contains the server code which polls for new notifications via the Lemmy API using the auth token. If you're curious, this is the repo: https://github.com/thunder-app/thunder_server. This is by no means complete and should not be ran (unless you're a developer and understand the implications of it) Doing this however, is a bit risky because the server has to store the auth token in order to perform actions as a given user, which can have fairly big security implications. In addition, the auth token doesn't have any scopes attached to it, so it acts as a master key and can basically perform anything and everything the user can. Support for this should be ideally done at the instance-side (Lemmy), and it looks like this is planned for the next major release (0.20.0): https://github.com/LemmyNet/lemmy/milestone/24. If this is implemented on Lemmy's side, then adding support for push notifications should be much easier and more secure (depending on how it's implemented) |
Is your feature request related to a problem? Please describe.
I would like to be informed when I receive responses.
Describe the solution you'd like
A push integration, preferably not from google but e.g. with UnifiedPush
The text was updated successfully, but these errors were encountered: