benwilkins / laravel-fcm-notification

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

Driver [fcm] not supported #19

Open greatsami opened 6 years ago

greatsami commented 6 years ago

Hi,

I installed the package in my project and i paste routeNotificationForFcm() in User model:

/**
 * Route notifications for the FCM channel.
 *
 * @return string
 */
public function routeNotificationForFcm()
{
    return $this->device_token;
}

Is it right?

but when i try to send Notification i get this error

Driver [fcm] not supported. {"exception":"[object] (InvalidArgumentException(code: 0): Driver [fcm] not supported. at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Manager.php:97)

how i can solve this error?

Thanks

benwilkins commented 6 years ago

Did you register the provider?

greatsami commented 6 years ago

Yes, sure.

junaid-A-khan commented 6 years ago

@greatsami what Laravel version you are on? did u try clearing out cache and if you are using queues/supervisor then try restarting them

p3ym4n commented 5 years ago

clean your bootstrap cache folder.

jaspervanbrian commented 5 years ago

Also for me. Driver [fcm] not supported

acip commented 5 years ago

We had the same issue on PHP 7.1.26. It might be a Laravel related issue, though.

vimalmistry commented 4 years ago

Same Issue. Any Update??

Dennis-Mwea commented 4 years ago

That's correct, there's no such driver as fcm. You need to pass the correct driver in your via method in notification class.

/**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [FcmChannel::class];
    }
rajuprasad21 commented 4 years ago

.ERROR: Driver [Benwilkins\FCM\FcmChannel] not supported I am getting this error. laravel version 6.2

MichaelMagomedov commented 4 years ago

+1

quang4dev commented 3 years ago

Same for me, solved it by adding the class FCMServiceProvider to config/app.php like this:

'providers' => [
    ...
    /**
     * FCM Notifications
     */
    FCMServiceProvider::class,
    ...
]
RizwanBlogger commented 11 months ago

We had the same issue on PHP 8.0. It might be a Laravel related issue, though. and Laravel version ^8.75. please help this solution solve

danillo10 commented 9 months ago

config/app.php providers = [..., NotificationChannels\Fcm\FcmServiceProvider::class] after public function via($notifiable) { return [FcmChannel::class]; } use NotificationChannels\Fcm\FcmMessage; solved