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

Not sending notification #125

Closed YosefOberlander closed 1 year ago

YosefOberlander commented 1 year ago

When using ->setAndroid as shown the readme, the notification does not send.

Using it this way works fine.

return FcmMessage::create() ->setData(['data1' => 'value', 'data2' => 'value2']) ->setNotification(\NotificationChannels\Fcm\Resources\Notification::create() ->setTitle('Account Activated') ->setBody('Your account has been activated.') ->setImage('http://example.com/url-to-image-here.png'));

Using it this way does not work.

return FcmMessage::create() ->setData(['data1' => 'value', 'data2' => 'value2']) ->setNotification(\NotificationChannels\Fcm\Resources\Notification::create() ->setTitle('Account Activated') ->setBody('Your account has been activated.') ->setImage('http://example.com/url-to-image-here.png')) ->setAndroid( AndroidConfig::create() ->setFcmOptions(AndroidFcmOptions::create()->setAnalyticsLabel('analytics')) ->setNotification(AndroidNotification::create()->setColor('#0A0A0A'));

dwightwatson commented 1 year ago

Happy to look over a PR that can correct this behaviour.