fcm
fcm copied to clipboard
Some of my notification show me errors
I am getting this error for notification. I followed all the step. and worked for some of my notification.
return FcmMessage::create()
// ->setData([
// 'status' => $status,
// 'link' => $link,
// 'id' => $id,
// ])
->setNotification(\NotificationChannels\Fcm\Resources\Notification::create()
->setTitle($subject)
->setBody($body)
->setImage($icon));
Looks like I have been, maybe the error in mothed routeNotificationForFcm() on User model:
public function routeNotificationForFcm() { return $this->deviceFCMs()->pluck('token')->toArray(); //or return 'string token'; }
The reason for this error is Passing of integer
value.
The text in the error (TYPE_STRING), 121
describes that error is due to value integer 121
(while it is expecting a string) in your data somewhere. When you convert the value in string
, it won't occur.
This is most likely due to data in FCM accepts string only.