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

Cannot Capture FCM Response #211

Closed artem-dev2 closed 1 week ago

artem-dev2 commented 2 weeks ago

I need to capture and log the response from FCM (e.g., to verify successful delivery or log errors), but it seems there’s no direct way to access the response after sending a notification.

Could you please tell me if there is a way or a woraround on this to capture thr response, Thx.

dwightwatson commented 2 weeks ago

So looks like right now I only fire the NotificationFailed event which means you don't have an opportunity to inspect successful responses.

Do you want to test out this PR #212 in your app and see if dispatching NotificationSent solves your issue?

artem-dev2 commented 1 week ago

I'm testing your PR the last two days and it works fine for me. Looking forward to have this marged to main branch.

dwightwatson commented 1 week ago

Thanks for that - tagged 4.4.0.

dwightwatson commented 1 week ago

Looks like this release broke some backwards compatibility, and these events were previously fired by Laravel. You should be able to continue listening to the NotificationSent event to handle the response as you need. I apologise for the mistake.