前置条件: 1.公众号为服务号,而非订阅号 2.认证(300元) 3.进入公众号申请模板推送功能 4.添加模板(注意:推送的消息只能使用微信提供的模板,不可自定义,但也是比较全的) 4.2 获取accessToken时,需要将开发环境的电脑ip添加到微信后台的ip白名单(线上环境亦是如此) 5.编码(可以先看下接口文档)【以下为无跳转功能示例代码】 public String test() { String templateId = "NtMhq-lqMiaORC4L95J_aODMzf-OhPZpD1dAgW7qvWs"; Map<Object, WeChatTemplateMsg> sendMap = new HashMap<>(); sendMap.put("first", new WeChatTemplateMsg("您好,有一个设备离线通知~")); sendMap.put("keyword1", new WeChatTemplateMsg("keyword1")); sendMap.put("keyword2", new...