Package com.foxinmy.weixin4j.wxa.api
Class SubscribeMessageApi
- java.lang.Object
-
- com.foxinmy.weixin4j.api.BaseApi
-
- com.foxinmy.weixin4j.wxa.api.SubscribeMessageApi
-
public class SubscribeMessageApi extends com.foxinmy.weixin4j.api.BaseApi
发送订阅消息。 发送订阅消息- Since:
- 1.9
-
-
Constructor Summary
Constructors Constructor Description SubscribeMessageApi(com.foxinmy.weixin4j.token.TokenManager tokenManager)
SubscribeMessageApi(com.foxinmy.weixin4j.token.TokenManager tokenManager, Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getRequestUri(String key)
void
sendSubscribeMessage(String toUser, String templateId, String page, Map<String,String> data)
发送订阅消息protected ResourceBundle
weixinBundle()
-
-
-
Constructor Detail
-
SubscribeMessageApi
public SubscribeMessageApi(com.foxinmy.weixin4j.token.TokenManager tokenManager)
-
SubscribeMessageApi
public SubscribeMessageApi(com.foxinmy.weixin4j.token.TokenManager tokenManager, Properties properties)
-
-
Method Detail
-
sendSubscribeMessage
public void sendSubscribeMessage(String toUser, String templateId, String page, Map<String,String> data) throws com.foxinmy.weixin4j.exception.WeixinException
发送订阅消息- Parameters:
toUser
- 接收者(用户)的 openid。templateId
- 所需下发的订阅模板idpage
- 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。data
- 模板内容,格式形如 { "key1": { "value": any }, "key2": { "value": any } }- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- indicates getting access token failed, or sending template message failed.- See Also:
- 发送订阅消息
-
weixinBundle
protected ResourceBundle weixinBundle()
- Specified by:
weixinBundle
in classcom.foxinmy.weixin4j.api.BaseApi
-
-