push 通知の証明書作成。毎回調べ直すのもアレなのでメモします。
とりあえず開発用は Apple Push Notification service SSL ( Sandbox ) を利用します。
Create a New Certificate
![](https://grtlab.com/wp-content/uploads//2022/01/ss-2022-01-17-17.08.53-1024x875.png)
Create a new Apple Notification service SSL
アプリのバンドルIDを選択します。
![](https://grtlab.com/wp-content/uploads//2022/01/ss-2022-01-17-17.09.11-1024x384.png)
証明書署名要求
Certificate Signing Request を作成
https://help.apple.com/developer-account/#/devbfa00fef7
「キーチェーンアクセス」を開いて
認証局に証明書を要求
![](https://grtlab.com/wp-content/uploads//2022/01/ss-2022-01-17-17.17.15-1024x528.png)
ディスクに保存、で続ける(作成
![](https://grtlab.com/wp-content/uploads//2022/01/ss-2022-01-17-17.18.48-1024x736.png)
![](https://grtlab.com/wp-content/uploads//2022/01/ss-2022-01-17-17.19.34-1024x732.png)
デスクトップに、CertificateSigningRequest.certSigningRequest が作成されるので
Update a Certificate Signing Request
choose file に先ほど作成されたcsrを
![](https://grtlab.com/wp-content/uploads//2022/01/ss-2022-01-17-17.21.51-1024x286.png)
Download Your Certificate
作成されたCertificateをダウンロードします。
![](https://grtlab.com/wp-content/uploads//2022/01/ss-2022-01-17-17.23.08-1-1024x224.png)
aps_development.cer をダブルクリックすると証明書がキーチェーンアクセスに入ります。
.p12ファイルを作成
![](https://grtlab.com/wp-content/uploads//2022/01/ss-2022-01-17-17.41.41-1024x441.png)
Apple Development iOS Push Service を選択して「書き出す」を選択
![](https://grtlab.com/wp-content/uploads//2022/01/ss-2022-01-17-17.45.00.png)
保存、パスワードは入れません。
![](https://grtlab.com/wp-content/uploads//2022/01/ss-2022-01-17-17.46.25.png)
p12 to pem 変換
$ openssl pkcs12 -in 証明書.p12 -out apns_dev_20220117.pem -nodes -clcerts Enter Import Password: MAC verified OK
apns_dev_20220117.pemをサーバーから送信するときに使います。
push 確認
$ php test.php Response from apple -> 200
送信確認できました^^
コメント