laravel-notification-channels / fcm

Firebase Cloud Messaging (FCM) notifications channel for Laravel
https://laravel-notification-channels.com/
MIT License
495 stars 127 forks source link

allow send to multiple projects at the same time with fcmProjects() #94

Closed tengkusyafiq closed 2 years ago

tengkusyafiq commented 2 years ago

This PR is created to allow sending same FCM notification to multiple project. This might be useful for super app.

Example:

    /**
     * Customized function to send to our specified channel.
     * @param $notifiable
     * @param $message
     * @return array|null
     */
    public function fcmProjects($notifiable, $message): ?array
    {
        return ['app_1', 'app_2'];
    }
l-alexandrov commented 2 years ago

@atymic What could I help with in order to get this PR accepted?

dwightwatson commented 2 years ago

I'm not overly familiar with the concept of "projects" but I'm concerned this might not be the right approach for solving this. Are push tokens scoped to a project? If so, wouldn't this implementation fire to all projects with all tokens even those that aren't relevant?