本文整理汇总了PHP中Channel::initAppIoscert方法的典型用法代码示例。如果您正苦于以下问题:PHP Channel::initAppIoscert方法的具体用法?PHP Channel::initAppIoscert怎么用?PHP Channel::initAppIoscert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel::initAppIoscert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_initAppIoscert
function test_initAppIoscert($name, $description, $release_cert, $dev_cert)
{
global $apiKey;
global $secretKey;
$channel = new Channel($apiKey, $secretKey);
//注意百度push服务对ios dev版与ios release版采用不同的域名.
//如果是dev版请修改push服务器域名"https://channel.iospush.api.duapp.com", release版则使用默认域名,修改域名使用setHost接口
//$channel->setHost("https://channel.iospush.api.duapp.com");
$ret = $channel->initAppIoscert($name, $description, $release_cert, $dev_cert);
if (false === $ret) {
error_output('WRONG, ' . __FUNCTION__ . ' ERROR!!!!');
error_output('ERROR NUMBER: ' . $channel->errno());
error_output('ERROR MESSAGE: ' . $channel->errmsg());
error_output('REQUEST ID: ' . $channel->getRequestId());
} else {
right_output('SUCC, ' . __FUNCTION__ . ' OK!!!!!');
right_output('result: ' . print_r($ret, true));
}
}
示例2: initBaiduCertIOS
static function initBaiduCertIOS($notifyMsg)
{
global $channels;
$channel = ChannlesMap::getChannel($notifyMsg->appid . '_' . $notifyMsg->restkey);
if ($channel !== false && $channel != null) {
return $channel;
}
$channel = new Channel($notifyMsg->appid, $notifyMsg->restkey);
// 请正确设置apiKey和secretKey,在开发者中心应用基本信息中查看
$channel->setHost('https://channel.iospush.api.duapp.com');
$fd = fopen(dirname(__FILE__) . "/baidu/cert/" . $notifyMsg->iosCertPath, 'r');
$dev_cert = fread($fd, filesize(dirname(__FILE__) . "/baidu/cert/" . $notifyMsg->iosCertPath));
// 开发版APNs pem证书
// var_dump($fd);
$fd_release = fopen(dirname(__FILE__) . "/baidu/cert/" . $notifyMsg->iosCertPathRel, 'r');
$release_cert = fread($fd_release, filesize(dirname(__FILE__) . "/baidu/cert/" . $notifyMsg->iosCertPathRel));
// 开发版APNs pem证书
// var_dump(dirname( __FILE__)."/baidu/cert/".$notifyMsg->iosCertPathRel);
// var_dump(dirname( __FILE__)."/baidu/cert/".$notifyMsg->iosCertPath);
$ret = $channel->initAppIoscert('yongqing li (95XW9X94ZC)', 'ios certification', $release_cert, $dev_cert);
// cert_name和cert_des您自定义字符串即可
if (false === $ret) {
var_dump('initBaiduCertIOS fail.');
var_dump($channel->errmsg());
} else {
var_dump('initBaiduCertIOS succ.');
ChannlesMap::setChannel($notifyMsg->appid . '_' . $notifyMsg->restkey, $channel);
}
return $channel;
}