[英]Voip Push notification is not working in ios 14 using php
任何人都知道將 VoIP 通知發送到 ios 14 到 php 需要進行哪些更改?
我已與 ios 開發人員確認,VoIP 通知似乎與 ios 13 一起使用,但不適用於 ios 14。
所以有人請建議一些相同的信息嗎?
此外,APNs 通知也適用於 ios 14,但唯一的問題是 VoIP 通知。
所以我想先了解一下下面的事情
提前感謝您的幫助。
以下是對我來說很好的解決方案。
我創建了一個文件test.php
和echo phpinfo();
進去。
然后檢查它的 curl 版本。 如果你得到
curl 版本 >= '7.58.0'
以及找到HTTP2 => Yes
的,否則不支持服務器。 如果沒有,則需要升級您的 curl 版本或升級 php 版本以確認是否支持 http/2 協議。
代碼:
if ( defined("CURL_VERSION_HTTP2") && (curl_version()["features"] & CURL_VERSION_HTTP2) !== 0) {
$ch = curl_init();
$body ['aps'] = array (
"alert" => array (
"status" => 1,
"title" => "source:123,destination:456",
"body" => "source:123,destination:456",
),
"badge" => 1 ,
"sound" => "default"
);
$curlconfig = array(
CURLOPT_URL => "https://api.development.push.apple.com/3/device/7B0DA62C06F3A4BA41470BE30D6D52BFD92E666BADAFCC943D265C43CB36897E",
CURLOPT_RETURNTRANSFER =>true,
CURLOPT_POSTFIELDS => json_encode($body),
CURLOPT_SSLCERT =>"testing.pem",
CURLOPT_SSLCERTPASSWD => "test123",
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0,
CURLOPT_VERBOSE => true
);
curl_setopt_array($ch, $curlconfig);
$res = curl_exec($ch);
if ($res === FALSE) {
echo('Curl failed: ' . curl_error($ch));
}
curl_close($ch);
}else{
echo "No HTTP/2 support on client.";
}
請注意,現在我沒有測試 ios13 是否支持 http/2。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.