-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Configuration / Clients #42
Multiple Configuration / Clients #42
Conversation
apemaia99
commented
Sep 29, 2023
- Now is possible to load multiple configurations, this is essential in order to send push notifications to different apps.
- Multiple clients are instantiated based on different configuration provided.
- FCM.ID is a convenience struct for identifying a specific client with a specific configuration.
…ssible to handle multiple clients at same time since he were looking up for config into application.storage (same for all). F added FCM.Storage layer to store hash map of multiple clients with relative configuration based on FCM.ID utility struct for identifying a client around your application.
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 |
Hey @MihaelIsaev, I'm happy for that, but unfortunately I found out a bug that I need to address before proceeding. |
R removed nil coalescing on default env keys, this can lead to a misbehavior when used with multiple instances. F added EnvironmentKeys enum that holds all possible env keys lookups already used F added specific lookup function in order to retrieve right value from environment based on correct FCM instance. In case of default instance, the current keys will be used without performing any concatenation in order to not break current api.
@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. |
… functions with .default instance parameter