php服务端发送推送消息能设置推送消息标题吗?声音?

user2
2017-05-25 08:56 1.8k 0
public function send($_msg_body = 'Hello, JPush', $_alias = 'all', $_platform = 'all'){
            $client = new \JPush\Client($this->_key, $this->_secret);        
            $pusher = $client->push();
            $pusher->setPlatform($_platform );
            if(strtolower($_alias) == 'all'){
                $pusher->addAllAudience();
            }else{
                $pusher->addAlias($_alias);        
            }
            $pusher->setNotificationAlert($_msg_body);

            try {
                $_rs = $pusher->send();
            } catch (\JPush\Exceptions\JPushException $e) {
                $_rs = $e;
            }
            return $_rs;
        }

1个回答

热门排序
  • user2
    2017-05-25 08:56

    这个是推送的方法,内容可以成功,就问一下标题和声音可以设置吗?