Closed paradyo closed 2 years ago
Could you please share the code that you're using? It might help me to reproduce the problem 😅
Could you please share the code that you're using? It might help me to reproduce the problem 😅
Ah, sorry. Here my code:
$tokens = ['abc', 'def']; $title = 'This is title!'; $desc = 'This is desc!'; Firebase::project('app')->auth(); $messagingInstance = Firebase::messaging(); $message = CloudMessage::new(); $message->withNotification(Notification::create($title, $desc)); $messagingInstance->sendMulticast($message, $tokens);
I deleted this code. And I solved with foreach the Single notification :(
Thanks.
CloudMessages are immutable, you should replace
$message = CloudMessage::new();
$message->withNotification(Notification::create($title, $desc));
with
$message = CloudMessage::new();
$message = $message->withNotification(Notification::create($title, $desc));
or
$message = CloudMessage::new()
->withNotification(Notification::create($title, $desc));
https://firebase-php.readthedocs.io/en/stable/cloud-messaging.html would also be a good read
CloudMessages are immutable, you should replace
$message = CloudMessage::new(); $message->withNotification(Notification::create($title, $desc));
with
$message = CloudMessage::new(); $message = $message->withNotification(Notification::create($title, $desc));
or
$message = CloudMessage::new() ->withNotification(Notification::create($title, $desc));
https://firebase-php.readthedocs.io/en/stable/cloud-messaging.html would also be a good read
It worked thankkss :))
Send multicast not working at Laravel. My devices are handling the push but not the data inside. The data prop is always null when I use the sendMulticast function.
Can you please share simple demo code for sendMulticast?
I tried the one at firebase-php doc but that's not working at Laravel.