public class CustomMsgSender extends Object
发送客服消息
| Constructor and Description |
|---|
CustomMsgSender(WeiXinConfig wxConf) |
| Modifier and Type | Method and Description |
|---|---|
WeiXinConfig |
getWeiXinConfig() |
GlobalReturnCode |
sendImageMsg(String toUser,
String mediaId)
发送图片消息
|
GlobalReturnCode |
sendMusicMsg(String toUser,
String title,
String description,
String musicUrl,
String hqMusicUrl,
String thumbMediaId)
发送音乐消息
|
GlobalReturnCode |
sendNewsMsg(String toUser,
NewsArticles... articles)
发送图文消息
|
GlobalReturnCode |
sendTextMsg(String toUser,
String content)
发送文本消息
|
GlobalReturnCode |
sendVideoMsg(String toUser,
String mediaId,
String title,
String description)
发送视频消息
|
GlobalReturnCode |
sendVoiceMsg(String toUser,
String mediaId)
发送语音消息
|
public CustomMsgSender(WeiXinConfig wxConf)
public WeiXinConfig getWeiXinConfig()
public GlobalReturnCode sendTextMsg(String toUser, String content)
toUser - 普通用户openidcontent - 文本消息内容,支持换行符public GlobalReturnCode sendImageMsg(String toUser, String mediaId)
toUser - 普通用户openidmediaId - 发送的图片的媒体IDpublic GlobalReturnCode sendVoiceMsg(String toUser, String mediaId)
toUser - mediaId - 发送的语音的媒体IDpublic GlobalReturnCode sendVideoMsg(String toUser, String mediaId, String title, String description)
toUser - mediaId - 发送的视频的媒体IDtitle - 视频消息的标题,可选.description - 视频消息的描述,可选.public GlobalReturnCode sendMusicMsg(String toUser, String title, String description, String musicUrl, String hqMusicUrl, String thumbMediaId)
toUser - title - 音乐标题,可选.description - 音乐描述,可选.musicUrl - 音乐链接hqMusicUrl - 高品质音乐链接,wifi环境优先使用该链接播放音乐thumbMediaId - 缩略图的媒体IDpublic GlobalReturnCode sendNewsMsg(String toUser, NewsArticles... articles)
toUser - articles - NewsArticles 一个或多个,图文消息条数限制在10条以内,注意,如果图文数超过10,则将会无响应。Copyright © 2012–2020 Wudao Software Studio. All rights reserved.