iOS 通知(推送)

iOS Notifications (Pusher)

我尝试使用 Pusher 将通知添加到我的 iOS 应用程序。 当我将我的设备令牌发送到服务器时,我遇到了这个问题:

Bad HTTP response: <NSHTTPURLResponse: 0x174032be0> { URL: https://nativepushclient-cluster1.pusher.com/client_api/v1/clients } { status code: 401, headers {
    Connection = "keep-alive";
    "Content-Length" = 125;
    "Content-Type" = "application/json";
    Date = "Thu, 09 Mar 2017 10:12:22 GMT";
    Server = Cowboy;
    Via = "1.1 vegur"; } } with body: Optional("{\"error\":\"Invalid application credentials for apns\",\"desc\":\"Unable to read your certificate: failed to decrypt private key\"}\n")

"{\"error\":\"Invalid application credentials for apns\",\"desc\":\"Unable to read your certificate: failed to decrypt private key\"

任何想法将不胜感激! (我确实已经将我的证书 .p12 转换为 .pem(一个文件中的证书 + 密钥,我应该创建两个文件吗?)

我做到了:

openssl pkcs12 -in path.p12 -out newfile.pem

我应该怎么做:

openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes

非常感谢!!!

我使用了 https://github.com/nomad/houston

中的教程
$ openssl pkcs12 -in cert.p12 -out apple_push_notification.pem -nodes -clcerts