我正在使用以下 php sdk 来生成推送梁推送通知。但是 sdk 文档中没有提供有关如何发送数据/有效负载的信息。通知是正确发送的 bean,但我无法发送数据:请指导我如何发送数据:它在光束控制台中显示 hasData 为 false,请检查:
我正在使用的php sdk:https ://github.com/pusher/push-notifications-php
我的代码如下所示:
$pushNotification = new PushNotifications([
'instanceId' => env('BEAM_INSTANCE_ID'),
'secretKey' => env('BEAM_PRIMARY_KEY')
]);
$pushNotification->publishToInterests(
['message-notification'],
[
"apns" => [
"aps" => [
"alert" => "Message Received",
],
],
"fcm" => [
"notification" => [
'title' => 'some title',
'body' => 'some body',
'data' => 'some data', //passing data here but not working
],
],
]
);