jpush php ios推送平台推送有消息和声音,但是代码推送没有声音
代码是这样的
public function addIosNotification($alert=null, $sound=null, $badge=null, $content_available=null, $category=null, $extras=null) {
$ios = array();
if (!is_null($alert)) {
if (!is_string($alert) && !is_array($alert)) {
throw new InvalidArgumentException("Invalid ios alert value");
}
$ios['alert'] = $alert;
}
if (!is_null($sound)) {
if (!is_string($sound)) {
throw new InvalidArgumentException("Invalid ios sound value");
}
if ($sound !== JPush::DISABLE_SOUND) {
$ios['sound'] = $sound;
}
} else {
// 默认sound为''
$ios['sound'] = 'sound.caf';
}