Closed Pangeranmw closed 1 year ago
The current readme shows how to handle expired tokens with dev-master
. You should look at the docs for the current tagged release: https://github.com/laravel-notification-channels/fcm/tree/3.2.1
Alternatively, you could use the latest 4.x beta and update your toFcm
with the newer syntax:
$notification = new Notification(title: 'Delivery Order Baru', body: "Terdapat Delivery Order baru dengan kode $this->kode");
return (new FcmMessage(notification: $notification))
->data([
'intentValueId' => "deliveryOrderId",
'intentKeyId' => "$this->id",
'kode' => "$this->kode",
])
->custom([
'android' => [
'data' => [
'intentValueId' => "deliveryOrderId",
'intentKeyId' => "$this->id",
'kode' => "$this->kode",
],
],
]);
The current readme shows how to handle expired tokens with
dev-master
. You should look at the docs for the current tagged release: https://github.com/laravel-notification-channels/fcm/tree/3.2.1
Current tag release doesnt have any docs for handle token removal?
Apologies. Listen for the same event but the payload is different. Looks like you worked it out: https://github.com/laravel-notification-channels/fcm/issues/173#issuecomment-1765700672
Sorry for the question, i'm already follow the docs about handling errors here, but expired token is not deleted in my database..
Here is my code:
User model
Device Token Model (attribute 'device_token' and 'user_id')
DeleteExpiredNotificationTokens listener
this is how i send some notification:
Some of my Notification Class
Do you have any advice?
Thanks