benwilkins / laravel-fcm-notification

Laravel FCM (Firebase Cloud Messaging) Notification Channel
MIT License
213 stars 91 forks source link

Supporting multiple api keys for multiple apps #66

Open bar2 opened 4 years ago

bar2 commented 4 years ago

Hey,

Current implementation resolves fcm channel with the fcm key from the services config, which, at least within my knowledge with the framework, stops me from setting a custom api key (or an alias for that api key for that matter) for a specific notification.

What would be the best way to achieve supporting multiple api keys within a single laravel project?

benwilkins commented 4 years ago

That functionality currently doesn't exist with this package.

bar2 commented 4 years ago

Any suggestions on a how-to?

AlsonicTech commented 2 years ago

If you store your key into services config, you can do this before creating the fcm instance (maybe in the notification constructor)

config(['services.fcm.key' => "NEW_KEY"]);

ankurk91 commented 2 years ago

https://github.com/ankurk91/fcm-notification-channel