Skip to content

消息群发,指定openid群发视频时,微信报错invalid message type hint: [JUs0Oa0779ge25] #757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tobecoder opened this issue Jun 23, 2017 · 1 comment

Comments

@Tobecoder
Copy link

我用的环境

PHP 版本:
overtrue/wechat 版本:3.1

问题及现象

消息群发,指定openid群发视频时,微信报错invalid message type hint: [JUs0Oa0779ge25]

微信官方文档中写的是
{
"touser":[
"OPENID1",
"OPENID2"
],
"mpvideo":{
"media_id":"123dsdajkasd231jhksad",
"title":"TITLE",
"description":"DESCRIPTION"
},
"msgtype":"mpvideo"
}

wechat/src/Broadcast/Transformer.php代码中:

public function transformVideo(array $message)
{
if (3 !== count($message)) {
throw new InvalidArgumentException('send message to openids, the message must be three arguments.');
}
return [
'video' => [
'media_id' => $message[0],
'title' => $message[1],
'description' => $message[2],
],
'msgtype' => 'video',
];
}

@overtrue
Copy link
Collaborator

你的调用代码贴一下

overtrue added a commit that referenced this issue Jun 23, 2017
@overtrue overtrue closed this as completed Jul 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants