gpt4 book ai didi

php - Laravel 推送通知 : certificate doesn't exist

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:32:12 25 4
gpt4 key购买 nike

我正在尝试将 Laravel 中的推送通知发送到 iOS 应用程序,我正在使用 Laravel 的 Push Notification Package .这是我的配置文件:

 return array(

'appNameIOS' => array(
'environment' => 'development',
'certificate' => base_path('app/cert/APNS_Cert_Hasalty_dev.p12'),
//I am using absolute path in the actual code
'passPhrase' => '',
'service' => 'apns'
),
'appNameAndroid' => array(
'environment' => 'production',
'apiKey' => 'yourAPIKey',
'service' => 'gcm'
)

);

这就是我发送通知的方式:

$payload = PushNotification::Message('Hello World, i`m a push message from hasalty', array(
'badge' => 1,
'sound' => 'default',
));

PushNotification::app('appNameIOS')
->to($deviceToken)
->send($payload);

现在,证书文件存在于配置中给定的路径中,但它向我抛出错误:

Certificate app/cert/APNS_Cert_Hasalty_dev.p12 does not exist

我做错了什么?有什么帮助吗?Laravel 的版本是 5.3.31

最佳答案

我明白了。事实上,我正在使用 .p12 文件并将其更改为 .pem 文件并且它有效。可以研究这些黑白的区别here .

关于php - Laravel 推送通知 : certificate doesn't exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45540288/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com