生成php所需要的APNS Service pem证书的步骤
1.登录到 iPhone Developer Connection Portal 并点击 App IDs
2.创建一个不使用通配符的 App ID 。通配符 ID 不能用于推送通知服务。例如,我们的iPhone程序ID像这样: AB123346CD.com.serverdensity.iphone
3.点击App ID旁的“Configure”,然后按下按钮生产 推送通知许可证。根据“向导”指导的步骤生成一个签名并上传,最后下载生成的许可证。此步骤在 Apple文档中 也有谈到。
4.通过双击.cer文件将你的 aps_developer_identity.cer 引入Keychain中。
5.在Mac上启动 Keychain助手,然后在login keychain中选择 Certificates分类。你将看到一个可扩展选项“Apple Development Push Services”
6.扩展此选项然后右击“Apple Development Push Services” > Export “Apple Development Push Services ID123”。保存为 apns-dev-cert.p12 文件。
7.需要通过终端命令将这些文件转换为PEM格式:
帮助
1 2 3 |
openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12 openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12 |
第二个语句,必须为他设置个rsa密码,如果你想要移除密码,要么在导出/转换时不要设定或者执行:
帮助
1 |
openssl rsa -in apns-dev-key.pem -out unencrypted.pem |
8.最后,你需要将键和许可文件合成为apns-dev.pem文件,此文件在连接到APNS时需要使用:
帮助
1 |
cat apns-dev-cert.pem unencrypted.pem > apns-dev.pem |
9.要对做成的证书做一个最后的测试,用SSL连接一下。
开发状态服务器地址 gateway.sandbox.push.apple.com 2195
产品状态服务器地址 gateway.push.apple.com 2195
帮助
1 2 |
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert apns-dev-cert.pem -key unencrypted.pem |
看看能不能成功
注:最后注意的事,也是我自己栽过的坑。证书分了两种一种是开发的用的,一种是发布的程序后用的。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Update: Saunders Tech has uploaded a tutorial to his YouTube channel (video embedded below) explaining how to install Fortnite and the Epic Games Store on an iPad outside the EU. However, not only does the process require specific beta versions of iO

Fresh details of Apple's HomePod-like device with an integrated screen have surfaced and they paint a clearer picture of the device which has been referred to as 'HomeAccessory'. When it launches, it will be Apple's answer to Google's Nest Hub Max an

Apple has finally lifted the covers off its new high-end iPhone models. The iPhone 16 Pro and iPhone 16 Pro Max now come with larger screens compared to their last-gen counterparts (6.3-in on the Pro, 6.9-in on Pro Max). They get an enhanced Apple A1

Apple has officially announced the iPhone 16 and iPhone 16 Plus, introducing key hardware updates with the new A18 chip. Both models come in two sizes—6.1 inches and 6.7 inches—with Super Retina XDR displays. They also feature aluminum designs and ar

The launches of Apple's next iPhones are not expected for at least another month. Nonetheless, footage showing dummy iPhone 16 units in what are said to be official launch colours continues to emerge online. Incidentally, while Google previously rele

Apple's next-generation iPhones are right around the corner. While the company has not shared the date of a new launch event yet, all signs appear to point to a September release, just like last year's iPhone 15 series. Incidentally, footage of dummy

Over a year has now passed from Meta's initial release of the Quest 3 (curr. $499.99 on Amazon). Since then, Apple has shipped the considerably more expensive Vision Pro, while Byte Dance has now unveiled the Pico 4 Ultra in China. However, there is

The Google Pixel 9 Pro and Pro XL are Google's answers to the likes of the Samsung Galaxy S24 Ultra and the Apple iPhone 15 Pro and Pro Max. Daniel Sin on YouTube(watch below) has compared the Google Pixel 9 Pro XL to the iPhone 15 Pro Max with some
