先去个推官网下载个推服务端SDK
个推sdk
public function pushUserInfo($cid,$title,$msg)
{
// 这是基本参数配置
// uniapp push也可使用
$api = new \GTClient("https://restapi.getui.com", "你的appkey", "你的appid", "你的masterSecret");
//设置推送参数
$push = new \GTPushRequest();
//需要使用随机 ,不可重复
$push->setRequestId(md5(time() . mt_rand(1, 9999999)));
$message = new \GTPushMessage();
$notify = new \GtNotification();
$notify->setTitle($title);
$notify->setBody($msg);
//消息通知的类型
$notify->setClickType('startapp');
$message->setNotification($notify);
$