Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 苹果没有回应_Php_Http Post_Apple Push Notifications - Fatal编程技术网

Php 苹果没有回应

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'

在建立到APNs的基于证书的连接后,我通过php发出了一个POST请求:

$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脚本有什么问题吗?或者我应该去仔细检查我的证书设置吗

提前谢谢