mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 16:35:53 +02:00
[GH-ISSUE #682] Dynamic FCM credentials #500
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#500
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AndreKR on GitHub (Mar 25, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/682
💡 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_keyandstorage_buckethave arrived from the server, they can be used to initialize FCM like this:💻 Target components
ntfy server + Android app
@binwiederhier commented on GitHub (Mar 25, 2023):
This is mindblowing to me. I did not know this is possible. I'd be happy to support this.
@FingerlessGlov3s commented on GitHub (Apr 14, 2023):
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?
@binwiederhier commented on GitHub (Apr 18, 2023):
No ETA, no.
FCM does receive the message contents. The proper place to ask this stuff is Discord/Matrix. Happy to answer questions there.
@AndreKR commented on GitHub (Apr 18, 2023):
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.
@FingerlessGlov3s commented on GitHub (Apr 18, 2023):
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.
@binwiederhier commented on GitHub (Apr 18, 2023):
@FingerlessGlov3s You more more than welcome to donate and/or buy a Pro subscription. Maybe that'll change my mind, haha 😄 Other than that, you can of course compile your own or add support yourself. ntfy is after all 100% open source.
@FingerlessGlov3s commented on GitHub (Apr 18, 2023):
💸
@binwiederhier commented on GitHub (Apr 18, 2023):
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.
@FingerlessGlov3s commented on GitHub (Apr 18, 2023):
It's great project, so I wanted to support. Hopefully you'll find some time at somepoint 😊
@AndreKR commented on GitHub (Apr 18, 2023):
@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. 🤷@binwiederhier commented on GitHub (Apr 21, 2023):
@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-fileoption, which allows you to drop your firebase creds file.@AndreKR commented on GitHub (Apr 23, 2023):
@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-filethough because that's the wrong file: Themy-app-1a2b3c4d5e.jsonfile does not contain the necessary values for the client, we also need thegoogle-services.jsonfile 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?
@rsporsche commented on GitHub (May 4, 2023):
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.
@emigrating commented on GitHub (Sep 1, 2023):
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.
@AndreKR commented on GitHub (Sep 1, 2023):
Not yet. It would make sense to remove the special role of the
DefaultBaseURLbut 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.@jangrewe commented on GitHub (Dec 16, 2023):
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
@FingerlessGlov3s commented on GitHub (Jan 19, 2024):
Did you document your process for building the app?
@user8446 commented on GitHub (Jul 24, 2024):
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:
https://github.com/domoticz/domoticz-android
@AndreKR commented on GitHub (Jul 24, 2024):
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.
@user8446 commented on GitHub (Jul 24, 2024):
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.
@kuolemaaa commented on GitHub (Dec 24, 2024):
Is this issue abandoned ? I really would like to have a mechanism to provide FCM creds without rebuild the apk every time
@MatthiasGrandl commented on GitHub (Apr 20, 2026):
@binwiederhier would you be open to contributions here? if yes, would it be acceptable to move the firebase credential config fully to the server and have the android client use whatever the server provides?