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