Open AndreKR opened 1 year ago
This is mindblowing to me. I did not know this is possible. I'd be happy to support this.
This would be really good news. Is there any ETA on this support?
Also probably not the place to ask but does the FCM, get told the content of the message or does it work like the iOS one with the SHA256?
No ETA, no.
FCM does receive the message contents. The proper place to ask this stuff is Discord/Matrix. Happy to answer questions there.
I'm not currently using ntfy but I probably will again in the future, so at some point I'll most likely contribute this, so far there just wasn't an urgent need.
Shame about the ETA, one of the main reasons I've not fully moved to ntfy. Once the support is there, I'd be quite happy knowing I'll get the noticaitons.
@FingerlessGlov3s You more more than welcome to donate and/or buy a Pro subscription. Maybe that'll change my mind, haha :smile: Other than that, you can of course compile your own or add support yourself. ntfy is after all 100% open source.
💸
Who knew?! All you have to do is ask for donations, and you'll get them. Haha. Much appreciated. I promise nothing, but I'll be sure to check it out when I work on Android next.
It's great project, so I wanted to support. Hopefully you'll find some time at somepoint 😊
@binwiederhier Maybe you could do the server side (add form fields to paste the four credential values or to paste/upload the google-services.json
+ API endpoints for the client), then I don't need to look into building the GUI and I can do the Android side then you don't need to look into initializing FCM. 🤷
@AndreKR You are assuming an implementation in your comment. I was just going to allow people to add their own credentials in the Android app. The ntfy server already has the firebase-file
option, which allows you to drop your firebase creds file.
@binwiederhier I would strongly recommend providing the FCM credentials from the server. Otherwise you would have to fiddle around with 4 values that are not easy to find nor easy to type, every time you want to subscribe to something. That would be terrible UX that can easily be avoided.
I now took a look at both server and client. Some ideas:
firebase-key-file
though because that's the wrong file: The my-app-1a2b3c4d5e.json
file does not contain the necessary values for the client, we also need the google-services.json
file on the server, which we can then provide to the clients. app_base_url
". Since the main goal is that we don't need a custom build anymore to use FCM we have to get rid of that constant.DefaultBaseURL
).WDYT?
I would also appreciate this feature. Just tried and failed to build the android app myself.
Edit: Managed to get it to work, just needed to sign the apk, but this would still be a nice feature.
Anyone taken on this for the official app? I'd rather not publish my own app, so being able to use official based on server.yaml config would be dope.
Not yet. It would make sense to remove the special role of the DefaultBaseURL
but that's quite a bit of work, so I'm a bit reluctant to just start with an implementation as long as we haven't agreed on what the desired implementation will look like. I might also need some guidance from @binwiederhier about some details regarding poll messages here and there.
I recently came across Ntfy (via Gatus) and set it up on my server, but was a bit disappointed that FCM doesn't work with the published Android app. As mentioned above, it shouldn't be too complicated to enable FCM for self-hosted instances, as i recently set up openHAB Cloud which also does notifications via FCM with their official app.
Maybe their app source is of any help when implementing this for the Ntfy app? 😃 https://github.com/openhab/openhab-android
I would also appreciate this feature. Just tried and failed to build the android app myself.
Edit: Managed to get it to work, just needed to sign the apk, but this would still be a nice feature.
Did you document your process for building the app?
I found this issue looking for the same request.
Like another post above, my home automation app has this as well if the source is any help:
I'm a bit familiar with the various home automation apps (although I use Home Asssistant myself) and as far as I remember neither of the two allow you to set FCM credentials. To my knowledge someone runs the server for OpenHAB (like Nabu Casa does for Home Assistant) while Domoticz I think has no direct FCM notifications at all.
Domoticz does have FCM fully self-hosted. Normally when you log-in the first time on a mobile device it syncs the UUID. If for some reason it doesn't there is even a button in the app to sync it. I can see the UUID from the mobile devices in Domoticz.
:bulb: Idea Currently the service URL is configurable but the FCM credentials are hardcoded, so changing them requires building and deploying a new build. I guess the reason is that it's done this way in the tutorial.
But technically there's no reason to do it like that. The credentials could just as well be made dynamic, in particular they could be fetched from the server.
When
project_id
,mobilesdk_app_id
,current_key
andstorage_bucket
have arrived from the server, they can be used to initialize FCM like this::computer: Target components ntfy server + Android app