SafariへのWebPush通知を作りたいと思い、勉強をしています。
公式ドキュメントを元に進めているのですが、なかなか情報が少なく困っています。
具体的には、上記URLの
『The Signature』の部分で、どうやら今年の2月に仕様が変わったみたいです。
↓Signatureの概要
The signature is a PKCS #7 detached signature of the manifest file. Sign the manifest file with the private key associated with your web push certificate that you obtained while registering with Apple. In PHP, you can do this with the openssl_pkcs7_sign function. The create_signature function in the attached createPushPackage.php companion file (the link is near the top of the page) shows how you can do this.If the contents of your push package ever change, you’ll need to recompute your signature.
↓2016年2月以降の仕様
Important: After February 14, 2016, you will need to sign the push package with both the web push certificate and the intermediate certificate. The updated create_signature function in the attached createPushPackage.php companion file processes both certificates.
こちらのURLが公式ドキュメントでも触れられている、createPushPackege.phpなのですが、create_signatureの関数をopenssl_pkcs7_signを用いて書き直す必要があるそうなのですが、やり方が分かっていません。
やはり2016年2月以降仕様が変わっていて、海外のサイトで質問がされていたりますが、Signatureがうまく作れていません。
createPushPackege.phpのcreate_signatureアクションの正しく動作するコードがお分かりの方いらっしゃったら教えてください。
あなたの回答
tips
プレビュー