Skip to content

wuwu123/youmeng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

友盟消息推送

安装


composer require wujie/youmeng

demo

设置配置文件

<?php
$config = new \Youmeng\Config\Config([
    'appKey' => '',
    'masterSecret' => '',
    'retryNum' => 1,//失败重试次数
    'production_mode' => 'true'
]);

推送

<?php

$comMessage = (new \Youmeng\Push\CommonMessage())
    ->setTitle("")
    ->setDesc("")
    ->setMessageType(\Youmeng\Push\Message::TYPE_CUSTOMIZE_CAST)
    ->setMessageData($alidateId)
    ->setOtherParams([]);

$sendRequest = new \Youmeng\Request\SendRequest($config);
$data = $sendRequest->androidMessage($signId, $comMessage);

查询推送状态

<?php
(new \Youmeng\Request\StatusRequest($config))->status($taskId);

取消定时任务

<?php
(new \Youmeng\Request\CancelRequest($config))->cancel($taskId);

上传任务

<?php

(new \Youmeng\Request\UpdateRequest($config))->update($content);