[英]How to send send push notification to multiple device using kreait/firebase cloud message in laravel
I'm trying to send a push notification to specific device (more than 1 device) 我正在尝试向特定设备(超过1个设备)发送推送通知
I've tried 我试过了
$device = array('device1','device2');
but error Kreait\\Firebase\\Messaging\\CloudMessage::withTarget() must be of the type string, array given
但是错误Kreait \\ Firebase \\ Messaging \\ CloudMessage :: withTarget()必须是字符串类型,给定数组
Also has tried 也尝试过
$device = 'device1,device2';
Also got an error. 也有一个错误。 On the api document, it doesn't mention about format to send to multiple device.
在api文档上,它没有提到要发送到多个设备的格式。
Anyone can help? 有人可以帮忙吗?
需要发送JSON数组,只需json_encode此数组。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.