【发布时间】:2021-08-31 01:50:17
【问题描述】:
这个问题之前被问过并且被忽略了,如果你有一个解决方案那么你的贡献是有价值的,如果我使用下面的代码,有没有办法改变 FCM 通知的默认声音,改变“声音“=>”到达“配乐路径不起作用? 谢谢你
public function toFcm($notifiable) {
$message = new FcmMessage();
$notification = [
'body' => trans('lang.notification_your_order', ['parcel_id' => $this->parcel->id, 'order_status' => $this->parcel->parcelStatus->status]),
'image' => Config::get('app.url').'/uploads/parcel.png',
'icon' => Config::get('app.url').'/uploads/parcel.png',
"title" => "Order Updated",
"content_available" => true,
"priority" => "high",
"sound"=>"arrive",
'id' => 'orders',
];
$data = [
'click_action' => "FLUTTER_NOTIFICATION_CLICK",
'id' => 'orders',
'status' => 'done',
'message' => $notification,
];
$message->content($notification)->data($data)->priority(FcmMessage::PRIORITY_HIGH);
return $message;
}
【问题讨论】:
标签: php laravel firebase-cloud-messaging