Class SaeAPNS
Apple 应用消息推送服务
<?php $cert_id = 1; $device_token = "xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx"; $message = "测试消息"; $body = array( 'aps' => array( 'alert' => $message , 'badge' => 1, 'sound' => 'in.caf') ); $apns = new SaeAPNS(); $result = $apns->push( $cert_id , $body , $device_token ); if( $result && is_array($result) ){ echo '发送成功!'; var_dump( $result ); } else { echo '发送失败。'; var_dump($apns->errno(), $apns->errmsg()); } ?>
错误码参考: - errno: 0 成功 - errno: -1 信息内容为空 - errno: -2 连接server http请求错误 - errno: -3 server端错误
- SaeObject
- SaeAPNS
public
|
|
public
boolean
|
|
public
mix
|
|
public
integer
|
|
public
string
|