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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Chinese version
Chinese version, very easy to use