Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/109.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS通知(推送器)_Ios_Swift_Push Notification_Pusher - Fatal编程技术网

iOS通知(推送器)

iOS通知(推送器),ios,swift,push-notification,pusher,Ios,Swift,Push Notification,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"; "

我尝试使用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")
错误的HTTP响应:{URL:https://nativepushclient-cluster1.pusher.com/client_api/v1/clients }{状态代码:401,标题{
连接=“保持活动”;
“内容长度”=125;
“内容类型”=“应用程序/json”;
日期=“2017年3月9日星期四10:12:22 GMT”;
服务器=牛仔;
Via=“1.1 vegur”;}}}正文:可选(“{\”错误\“:\”apns的应用程序凭据无效“,\”描述\“:\”无法读取您的证书:无法解密私钥\“}\n”)
“{\”错误\“:\”的应用程序凭据无效 apns\”,\“desc\”:\“无法读取您的证书:解密失败。” 私钥\“

如有任何想法,我们将不胜感激! (我确实已经将我的证书.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

非常感谢!!!我使用了


有时,您必须重新生成资源调配配置文件。
$ openssl pkcs12 -in cert.p12 -out apple_push_notification.pem -nodes -clcerts