laravel-notification-channels / fcm

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

how we send web notification using the setWebPush plz guide me #119

Closed salmansafdar778 closed 2 years ago

salmansafdar778 commented 2 years ago

how we use this function setWebpush(NotificationChannels\Fcm\Resources\WebpushConfig $webpushConfig)

what's the $webpushConfig?

lianmaymesi commented 2 years ago
public function toFcm($notifiable) 
     { 
         return FcmMessage::create() 
             ->setNotification( 
                 \NotificationChannels\Fcm\Resources\Notification::create() 
                     ->setTitle('Excel uploading status') 
                     ->setBody($this->data['type'] . ' data uploading failed!') 
                     ->setImage('imageUrl') 
             ) 
             ->setWebpush( 
                 WebpushConfig::create() 
                     ->setFcmOptions(WebpushFcmOptions::create()) 
             ); 
}