123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- // +----------------------------------------------------------------------
- // | WeChatDeveloper
- // +----------------------------------------------------------------------
- // | 版权所有 2014~2023 ThinkAdmin [ thinkadmin.top ]
- // +----------------------------------------------------------------------
- // | 官方网站: https://thinkadmin.top
- // +----------------------------------------------------------------------
- // | 开源协议 ( https://mit-license.org )
- // | 免责声明 ( https://thinkadmin.top/disclaimer )
- // +----------------------------------------------------------------------
- // | gitee 代码仓库:https://gitee.com/zoujingli/WeChatDeveloper
- // | github 代码仓库:https://github.com/zoujingli/WeChatDeveloper
- // +----------------------------------------------------------------------
- namespace WeMini;
- use WeChat\Contracts\BasicWeChat;
- /**
- * 小程序动态消息
- * Class Message
- * @package WeMini
- */
- class Message extends BasicWeChat
- {
- /**
- * 动态消息,创建被分享动态消息的 activity_id
- * @param array $data
- * @return array
- * @throws \WeChat\Exceptions\InvalidResponseException
- * @throws \WeChat\Exceptions\LocalCacheException
- */
- public function createActivityId($data)
- {
- $url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/activityid/create?access_token=ACCESS_TOKEN';
- return $this->callPostApi($url, $data, true);
- }
- /**
- * 动态消息,修改被分享的动态消息
- * @param array $data
- * @return array
- * @throws \WeChat\Exceptions\InvalidResponseException
- * @throws \WeChat\Exceptions\LocalCacheException
- */
- public function setUpdatableMsg($data)
- {
- $url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/updatablemsg/send?access_token=ACCESS_TOKEN';
- return $this->callPostApi($url, $data, true);
- }
- /**
- * 下发小程序和公众号统一的服务消息
- * @param array $data
- * @return array
- * @throws \WeChat\Exceptions\InvalidResponseException
- * @throws \WeChat\Exceptions\LocalCacheException
- */
- public function uniformSend($data)
- {
- $url = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN';
- return $this->callPostApi($url, $data, true);
- }
- }
|