laravel-notification-channels / fcm

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

Pass token to notification failed event #127

Closed MarcEspiard closed 1 year ago

MarcEspiard commented 1 year ago

This commit adds the token value to the NotificationFailed $data parameter.

Context: In our use case, we need to remove the token from our database when a notification fails due to a token being either expired or invalid. Having this value passed in the event is safer than trying to retrieve said token from database as retrieving it could be subject to race conditions at scale (example: while notification is attempted, token is updated in database by user, notification fails then deletes the new token instead of the one that actually failed)

dwightwatson commented 1 year ago

Good call, thanks

MarcEspiard commented 1 year ago

@dwightwatson No problem, if you could release at the same time that'd be great :) Thank you

dwightwatson commented 1 year ago

Easy, tagged 2.6.0