laravel-fcm-notification icon indicating copy to clipboard operation
laravel-fcm-notification copied to clipboard

Driver [fcm] not supported

Open greatsami opened this issue 6 years ago • 13 comments

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

greatsami avatar May 16 '18 20:05 greatsami

Did you register the provider?

benwilkins avatar May 24 '18 17:05 benwilkins

Yes, sure.

greatsami avatar May 25 '18 01:05 greatsami

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

junaid-A-khan avatar Sep 11 '18 13:09 junaid-A-khan

clean your bootstrap cache folder.

p3ym4n avatar Oct 12 '18 07:10 p3ym4n

Also for me. Driver [fcm] not supported

jaspervanbrian avatar Apr 03 '19 18:04 jaspervanbrian

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

acip avatar Aug 01 '19 16:08 acip

Same Issue. Any Update??

vimalmistry avatar Jun 15 '20 23:06 vimalmistry

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];
    }

Dennis-Mwea avatar Jun 18 '20 10:06 Dennis-Mwea

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

rajuprasad21 avatar Jul 09 '20 11:07 rajuprasad21

+1

MichaelMagomedov avatar Aug 04 '20 22:08 MichaelMagomedov

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

'providers' => [
    ...
    /**
     * FCM Notifications
     */
    FCMServiceProvider::class,
    ...
]

quang4dev avatar Apr 11 '21 04:04 quang4dev

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

RizwanBlogger avatar Oct 06 '23 04:10 RizwanBlogger

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

danillo10 avatar Dec 01 '23 12:12 danillo10