Php 苹果没有回应
在建立到APNs的基于证书的连接后,我通过php发出了一个POST请求:Php 苹果没有回应,php,http-post,apple-push-notifications,Php,Http Post,Apple Push Notifications,在建立到APNs的基于证书的连接后,我通过php发出了一个POST请求: $url = 'api.push.apple.com:2197'; $device_token = '7ef5e713c3c09597b6ac5ed598ee98512e6e67e8a84e3b30a57632947f21704a'; $response = Http::withHeaders([ 'method' => 'POST', 'scheme' => 'https'
$url = 'api.push.apple.com:2197';
$device_token = '7ef5e713c3c09597b6ac5ed598ee98512e6e67e8a84e3b30a57632947f21704a';
$response = Http::withHeaders([
'method' => 'POST',
'scheme' => 'https',
'path' => '/3/device/' . $device_token,
'host' => 'api.sandbox.push.apple.com',
'apns-push-type' => 'alert',
'apns-expiration' => '0',
'apns-priority' => '10',
'apns-topic' => 'com.charlotte.DaKaRiBao'
])->post($url, ['aps' => ['alert' => 'Hello']]);
var_dump($response);
然而,我得到的结果是:
string(0) ""
我没有收到任何推送到我设备上的通知
我确保我的证书工作正常。我的php脚本有什么问题吗?或者我应该去仔细检查我的证书设置吗
提前谢谢