通知被发送了,没问题,我希望在通知上有一个徽章,它从来没有使用过,我翻遍了所有的firebase文档,什么也没做。关键字字段也是如此。
套餐使用: edujugon/push-notification:4.5
$devices[] = $deviceData['id'];
$push = new PushNotification('fcm');
$push->setMessage([
'notification' => [
'title' => $this->title,
'body' => $this->body,
'badge' => $this->badge,
],
])
->setApiKey($this->apiKeyFirebase)
->setDevicesToken($devices)
->send();发送此数组后,我在IOS下没有收到通知,因此来自ios服务器的反馈告诉我,通知已发送,我发送的数组的密钥一定有问题,我没有找到,有人会知道吗?
$devices[] = $deviceData['id'];
$push = new PushNotification('apn');
$push->setMessage([
'aps' => [
'alert' => [
'title' => $this->title,
'body' => $this->body,
],
'badge' => $this->badge,
],
])
->setConfig($this->getConfig())
->setDevicesToken($devices)
->send();发布于 2021-02-08 17:46:25
是的,反馈:
object(stdClass)#157 (3) {
["success"]=>
int(1)
["failure"]=>
int(0)
["tokenFailList"]=>
array(0) {
}
}它告诉我成功是真的,但我在ios上没有收到通知,它是不可见的
发布于 2021-02-08 23:31:28
通过库sly/notification-pusher,我收到了推送通知ios,但我没有标题:(
$messages = [$this->body];
$params = ['title' => $this->title];
$pushNotificationService = new ApnsPushService(
$certificatePath, $passPhrase, PushManager::ENVIRONMENT_PROD
);
$response = $pushNotificationService->push($devices, $messages, [
'aps' => [
'alert' => [
'title' => $this->title,
'body' => $this->body,
],
'badge' => $this->badge,
]
]);https://stackoverflow.com/questions/66066374
复制相似问题