连接失败:0 推送通知 [英] Failed to connect: 0 push notification

查看:28
本文介绍了连接失败:0 推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行下面的代码时,它正在获取

When i execute the below code it is getting

连接失败:0

1) 我的 .pem 文件路径是正确的.下面是我执行的代码.我对代码中发生的这个 dono wats 是全新的.

1) My path to .pem file is correct.Below is the code which i executed. Iam completely new for this dono wats happening in the code.

我把代码放在下面

$deviceToken = '44fb58e8011392a1569ddc73ff96d028b5d78739258678455a16abf4e55fa1c1';
//$deviceToken = '44fb58e8011392a1569ddc73ff96d028b5d78739258678455a16abf4e55fa1c1';

// Put your private key's passphrase here:
$passphrase = 'zFaMRvDh7vGTPqh3k+72uz0SzOh3knVZc99OPqkJ3llbYWbpQnRNAKY7TGJu7kg8';

// Put your alert message here:
$message = 'Thank you for Trying Arial 1. Do not forget to enter your feedback to earn TNB points within 10 days';

////////////////////////////////////////////////////////////////////////////////

$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'http://dev.trynbuyindia.com/ck.pem');
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);

// Open a connection to the APNS server
$fp = stream_socket_client(
    'ssl://gateway.sandbox.push.apple.com:2195', $err,
    $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);

if (!$fp)
    exit("Failed to connect: $err $errstr" . PHP_EOL);

推荐答案

dev.trynbuyindia.com/ck.pem 是否正确..???

dev.trynbuyindia.com/ck.pem is this correct..???

将您的证书放在您运行 php 脚本的本地机器的同一文件夹中,并在脚本中更改其路径

Put your certificate in local machine same folder from where you are running php script and change its path in the script

这篇关于连接失败:0 推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆