MihaelIsaev / FCM

⚡️ PushNotifications through FireBase for Vapor 3 and 4.
MIT License
125 stars 36 forks source link

Multiple Configuration / Clients #42

Closed apemaia99 closed 3 months ago

apemaia99 commented 1 year ago
MihaelIsaev commented 6 months ago

Hey @apemaia99 thanks for that great contribution! Sorry that it took so long to review it. It would be great if you also could update readme for these changes and I'd love to tag it as v3.0.0

apemaia99 commented 6 months ago

Hey @MihaelIsaev, I'm happy for that, but unfortunately I found out a bug that I need to address before proceeding. Since my implementation allows multiple clients at same time, each client tries to find the same KEY in the environment this can be very dangerous, I need to find another solution. Personally I don't use the env keys as configuration method and that's why I didn't catch it early in the development.

apemaia99 commented 5 months ago

@MihaelIsaev I've found a solution for getting right keys based on FCM.ID, I try to explain it with an example.

let's take as example email env key "FCM_EMAIL", in this case:

this solution seems to not break current APIs.

Let me know your opinion and if is ok I'm going to update the readme.