\WeChatReceive

公众号推送管理 Class Receive

Summary

Methods
Properties
Constants
__construct()
reply()
getReceive()
getOpenid()
getMsgType()
getMsgId()
getMsgTime()
getToOpenid()
transferCustomerService()
text()
news()
image()
voice()
video()
music()
No public properties found
No constants found
No protected methods found
$appid
$postxml
$encryptType
$config
$params
$receive
$message
N/A
checkSignature()
No private properties found
N/A

Properties

$appid

$appid : string

公众号APPID

Type

string

$postxml

$postxml : string

公众号推送XML内容

Type

string

$encryptType

$encryptType : string

公众号推送加密类型

Type

string

$message

$message : array

准备回复的消息内容

Type

array

Methods

__construct()

__construct(array  $options) 

BasicPushEvent constructor.

Parameters

array $options

Throws

\WeChat\Exceptions\InvalidResponseException

reply()

reply(array  $data = array(), boolean  $return = false) : string

回复消息

Parameters

array $data

消息内容

boolean $return

是否返回XML内容

Throws

\WeChat\Exceptions\InvalidDecryptException

Returns

string

getReceive()

getReceive(null|string  $field = null) : array

获取公众号推送对象

Parameters

null|string $field

指定获取字段

Returns

array

getOpenid()

getOpenid() : string

获取当前微信OPENID

Returns

string

getMsgType()

getMsgType() : string

获取当前推送消息类型

Returns

string

getMsgId()

getMsgId() : string

获取当前推送消息ID

Returns

string

getMsgTime()

getMsgTime() : integer

获取当前推送时间

Returns

integer

getToOpenid()

getToOpenid() : string

获取当前推送公众号

Returns

string

transferCustomerService()

transferCustomerService(string  $account = '') : $this

转发多客服消息

Parameters

string $account

Returns

$this

text()

text(string  $content = '') : $this

设置文本消息

Parameters

string $content

文本内容

Returns

$this

news()

news(array  $newsData = array()) : $this

设置回复图文

Parameters

array $newsData

Returns

$this

image()

image(string  $mediaId = '') : $this

设置图片消息

Parameters

string $mediaId

图片媒体ID

Returns

$this

voice()

voice(string  $mediaid = '') : $this

设置语音回复消息

Parameters

string $mediaid

语音媒体ID

Returns

$this

video()

video(string  $mediaid = '', string  $title = '', string  $description = '') : $this

设置视频回复消息

Parameters

string $mediaid

视频媒体ID

string $title

视频标题

string $description

视频描述

Returns

$this

music()

music(string  $title, string  $desc, string  $musicurl, string  $hgmusicurl = '', string  $thumbmediaid = '') : $this

设置音乐回复消息

Parameters

string $title

音乐标题

string $desc

音乐描述

string $musicurl

音乐地址

string $hgmusicurl

高清音乐地址

string $thumbmediaid

音乐图片缩略图的媒体id(可选)

Returns

$this

checkSignature()

checkSignature(string  $str = '') : boolean

验证来自微信服务器

Parameters

string $str

Returns

boolean