简体   繁体   English

如何在Laravel中使用Kreait / Firebase云消息向多个设备发送发送推送通知

[英]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.

相关问题 如何使用触发器发送Firebase推送通知 - How to send firebase push notification using trigger 如何将推送通知从 Firebase 发送到 iOS 设备上的 web 应用程序? - How to send push notification from Firebase to web app on iOS device? 我们如何使用Firebase云消息传递(fcm)在Android中发送推送通知来发送图像和图标 - How we can send image and icon by using Firebase cloud messaging(fcm) for push notification in android 如何在Laravel 5.1中使用AWS SNS将推送通知从Web发送到iOS和android设备? - How to send push notification from web to iOS and android device using AWS SNS in Laravel 5.1? 如何将Chrome推送通知发送到多个设备 - How to send Chrome push notification to mulitple device 如何将附加数据发送到 Firebase 推送通知 - How to send additional data to firebase push notification Firebase Cloud Messaging PHP集成发送推送通知 - Firebase Cloud Messaging PHP Integration send push notification 谷歌云消息发送通知,但我的设备从未被推送 - google cloud message send notification but my device is never pushed 将 Android 推送通知发送到多个设备的 PHP 代码 - PHP code to send Android push notification to multiple device 将Firebase推送通知发送给不工作的多个用户-php - Send firebase push notification to multiple users not working -php
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM