这是我调用的方法 /** * 微信一次性订阅消息 */ public void SubscribeMessage(String hnUserID,WxListener subscribeMessgeListener) { IWXAPI subscribeApi = WXAPIFactory.createWXAPI(HnApplication.getApp(), HnConstants.WX_PUBLIC_APP_ID, true); subscribeApi.registerApp(HnConstants.WX_PUBLIC_APP_ID); if (!subscribeApi.isWXAppInstalled()) { UiUtil.toast("请先安装微信应用"); return; } this.subscribeMessgeListener = subscribeMessgeListener; SubscribeMessage.Req req = new SubscribeMessage.Req(); req.scene = SUBSCRIBE_MESSAGE_SCENE; req.templateID = SUBSCRIBE_MESSAGE_TEMPLATEID; req.reserved = hnUserID; subscribeApi.sendReq(req); }
一次性订阅消息 提示跳转失败如题,有哪位大神给解答一下 SubscribeMessage.Req req = new SubscribeMessage.Req(); req.scene = SUBSCRIBE_MESSAGE_SCENE; req.templateID = SUBSCRIBE_MESSAGE_TEMPLATEID; try { req.reserved = URLEncoder.encode(hnUserID,"utf-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } api.sendReq(req); [图片]
2019-07-17