android icon indicating copy to clipboard operation
android copied to clipboard

Forward notification to other apps

Open krombel opened this issue 6 years ago • 19 comments

It would be nice if this app can be used as forwarder for notifications to use gotify instead of FCM for notification handling.

An alternative/intermediate solution might be that a tap on the notification opens my app

krombel avatar Nov 22 '18 07:11 krombel

I also think this would be a great enhancement for gotify, if it could be used as an alternative to the proprietary Google FCM.

For this, it would be necessary to perform some changes and additions to the gotify API and client, to distinguish between notifications that would be shown directly by gotify and some sort of 'trigger' notification which would be forwarded to a third-party app. All of this logic on how an app could register it's usage of gotify and the notification forwarding would have to be thought on.

Are there any plans or comments if and how this could be implemented? I would be interested in contributing ideas and code in some of my free time if there are others interested as well.

ialokim avatar Nov 23 '18 21:11 ialokim

I'm open to idea's as well.

I can think of two implementations

  1. Specifying an android activity on the message. This activity then will be started when the notification is clicked
  2. Add a global android broadcast on which other apps can subscribe

jmattheis avatar Nov 23 '18 21:11 jmattheis

What about using Android Services as FCM does? Inside the user's app you would have to declare a service using a specific intent-filter with a class similar to FirebaseMessagingService that could be called when recieving a notification. Or is this not possible due to Android restrictions?

ialokim avatar Nov 23 '18 23:11 ialokim

@ialokim sorry for answering that late, I've must've overlooked this message :\

I dunno exactly how the FirebaseMessagingService works but I'm guessing that its with broadcasts. The Gotify android app should be able to send broadcasts like this.

jmattheis avatar Dec 28 '18 11:12 jmattheis

What about integration with Tasker? That would be megapowerful:)

sik0vny avatar Jan 23 '19 01:01 sik0vny

Heya, has there been any progress on this? I saw the related PR but that didn't receive any activity in three months :/

Sorunome avatar Sep 18 '20 11:09 Sorunome

Nope, sadly no.

jmattheis avatar Sep 18 '20 17:09 jmattheis

I found a similar project to this issue https://bubu1.eu/openpush/

karmanyaahm avatar Oct 25 '20 20:10 karmanyaahm

There is a new branch: unifiedpush that allows gotify to forward notifications : [edit] All the needed informations are here : https://unifiedpush.org/users/distributors/gotify/

p1gp1g avatar Dec 28 '20 16:12 p1gp1g

A hacky soution is to simply catch the broadcasted com.github.gotify.service.WebSocketService.NEW_MESSAGE intent, see https://github.com/gotify/android/issues/44#issuecomment-808758340, to catch the notification from any other app. To hide the notification the easiest solution is to diable the notifications for whole priority level in Android's notification settings. However, I'd prefer a proper solution which allows to push silent messages, which are also not shown in the Gotify app, as well.

buergi avatar Mar 27 '21 16:03 buergi

However, I'd prefer a proper solution which allows to push silent messages, which are also not shown in the Gotify app, as well.

These apps are already able to receive notifications with gotify (silently) : https://unifiedpush.org/users/apps/

p1gp1g avatar Apr 07 '21 09:04 p1gp1g

Is there any plan to merge the unifiedpush branch to master/main ?

genofire avatar Jul 07 '21 20:07 genofire

From my point of view, UnifiedPush still needs more adoption so that it can be integrated into gotify.

jmattheis avatar Jul 07 '21 20:07 jmattheis

Right now there is a broken version of UnifiedPush in a fork that has little impetus to be fixed and upgraded to a working version and I am being advised to switch provider because it and I quote "(probably) won't be updated". I like gotify, and I have been running it for a LONG time now, I don't want to switch provider because then I have to rework all my integrations for my other stuff. Is your PoV still the same one year down the line (note: Tusky beta is using UP and cannot use gotify-up).

iMartyn avatar Jun 21 '22 16:06 iMartyn

Do you have installed the common-proxy infront of your gotify?

By the way Element has also merged UnifiedPush (and FluffyChat and SchildChat another Matrix client), too.

ntfy.sh on serverside has implement both /UP and /_matrix pushes, like in common-proxy. (I do not like the quality of code, but it makes his job really good - so i switched last week, because the unwilling of gotify to implement UnifiedPush)

I try to implement in /UP but it was rejected https://github.com/gotify/server/pull/420

genofire avatar Jun 21 '22 20:06 genofire

Yeah, I have common-proxy in front and it works for example-UP app, but tusky specifically requests binary mode and therefore gotify-up doesn't respond, because that's broken if you have postgres.

iMartyn avatar Jun 21 '22 21:06 iMartyn

Yeah, I more or less have the same opinion now. Mostly, I don't want the effort of maintaining this feature I don't need. To me, it feels like Gotify isn't the right tool for this, or at least I didn't intend it to be used like this. It is possible to use it as distributor, but it doesn't really have the resilience it should have for this, like a proper way to duplicate data / having high availability and first class support of redelivery of messages.

This problem with gotify-UP not working also seems like a maintenance problem, because a new api / feature isn't implemented, and I want to keep gotify as low maintenance as possible for me, I rather do new stuff. This doesn't mean that Gotify is dead, it still gets updates, and I'll do reviews for approved features that improve core functionality. Core functionality in this sense is, simply sending messages via the api and get them on the phone / webapp.

Tbh., I'm unsatisfied with my opinion on this, but I've thought about this a long time and I always come to the same conclusion. I don't want to use my time for features I don't really need or support. I can already have that at my day job (:. Hope this is understandable.

As a side note, there is https://github.com/pushbits/server which has an api compatible with Gotify but uses Matrix for receiving the messages on your phone. This means you get all the benefits from this, like encryption of the messages and stuff. Maybe this is something that would solve your use-case.

jmattheis avatar Jun 22 '22 19:06 jmattheis

I don't want to use my time for features I don't really need or support.

100% understandable, sorry to have bother you so long with this then :laughing: . It can be a good idea to close this issue then :)

PS: It will probably help future users looking at this issue : if you are looking for a decentralized equivalent to FCM. Then check https://unifiedpush.org

p1gp1g avatar Aug 25 '22 12:08 p1gp1g

@jmattheis funny way - using ntfy.sh to get pushnotification for matrix, to use pushbits .....

genofire avatar Aug 28 '22 13:08 genofire

Any progress to get support for https://unifiedpush.org/ going again as https://unifiedpush.org/users/distributors/gotify/ lists it as deprecated ?

PanderMusubi avatar Nov 24 '22 21:11 PanderMusubi

@PanderMusubi: no, my https://github.com/gotify/android/issues/29#issuecomment-1163522251 still stands. I'll close this issue, as it won't be natively supported.

jmattheis avatar Nov 29 '22 16:11 jmattheis