capacitor-community / fcm

Enable Firebase Cloud Messaging for Capacitor apps
https://capacitor.ionicframework.com/docs/
MIT License
237 stars 83 forks source link

Multiple SenderIDs/FCM projects? #60

Open thequailman opened 3 years ago

thequailman commented 3 years ago

Is your feature request related to a problem? Please describe. Maybe? I have an app that I don't want to ship credentials with. Instead, I want the app to contact a server to discover the FCM details for SenderID etc. My app can connect to a self hosted server setup, so I want to support self hosted users using FCM. I think this is possible today using native FCM and calling getToken after GETing a senderID.

Describe the solution you'd like I'd like to have my app be able to initialize FCM's config (senderID specifically) in JS on iOS and Android. I currently do this today for the PWA. Ideally I wouldn't have to provide the FCM credentials as a plist or JSON file, but I'm fine doing that if I can overwrite those values in JS.

Describe alternatives you've considered I think it's fine if I can't do this, but it would be really cool if it works!!

Additional context

KuhlTime commented 1 year ago

@thequailman, have you found a solution to this problem? I am facing the same issue. I have a multi-tenant infrastructure where the correct Firebase project can only be determined at runtime.