wujie / youmeng
友盟消息推送
1.16.0
2022-10-21 08:18 UTC
Requires
- php: >=7.1
- ext-json: *
- guzzlehttp/guzzle: ^6.3|^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
README
安装
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);