- 请问点击公众号的自定义菜单进入小程序该用哪个接口?
希望在公众号的自定义菜单里设置一个跳转小程序的接口,并把用户的unionID传过去。 在公众号的文档里没找到相关说明,还请指明。谢谢。
2018-10-09 - 一次性订阅消息无法显示内容
按照文档向用户发送一次性订阅消息,代码片段如下 [代码]String accessToken = getAccessToken();[代码][代码]String uri = [代码][代码]"https://api.weixin.qq.com/cgi-bin/message/template/subscribe?access_token="[代码] [代码]+ accessToken;[代码][代码] [代码] [代码] [代码][代码]BasicDBObject content = [代码][代码]new[代码] [代码]BasicDBObject();[代码][代码] [代码][代码]content.append([代码][代码]"value"[代码][代码], [代码][代码]"test test \n test test"[代码][代码]);[代码][代码] [代码][代码]content.append([代码][代码]"color"[代码][代码], [代码][代码]"#1B5E20"[代码][代码]);[代码][代码] [代码][代码]BasicDBObject testData = [代码][代码]new[代码] [代码]BasicDBObject();[代码][代码] [代码][代码]testData.append([代码][代码]"content"[代码][代码], content);[代码][代码] [代码] [代码] [代码][代码]BasicDBObject postData = [代码][代码]new[代码] [代码]BasicDBObject();[代码][代码] [代码][代码]postData.append([代码][代码]"touser"[代码][代码], toUser)[代码][代码] [代码][代码].append([代码][代码]"template_id"[代码][代码], template_id)[代码][代码] [代码][代码].append([代码][代码]"url"[代码][代码], url)[代码][代码] [代码][代码].append([代码][代码]"scene"[代码][代码], scene)[代码][代码] [代码][代码].append([代码][代码]"title"[代码][代码], title)[代码][代码] [代码][代码].append([代码][代码]"data"[代码][代码], testData);[代码][代码] [代码] [代码] [代码][代码]logger.info(postData.toJson());[代码][代码] [代码] [代码] [代码][代码] [代码][代码]String resp = postRequestJson(uri, postData.toJson());[代码] 系统log如下: [代码]21-Sep-2018 19:17:29.955 INFO [http-nio-443-[代码][代码]exec[代码][代码]-48] helper.WeixinAppHelper.subscribeMsg { [代码][代码]"touser"[代码] [代码]: [代码][代码]"oKn3lvkut8w-H0oM2c-3Rhsqx70o"[代码][代码], [代码][代码]"template_id"[代码] [代码]: [代码][代码]"k5dLFam6GtlfptCMkbR02eqIeO22oNqn8SaL1bSSuc4"[代码][代码], [代码][代码]"url"[代码] [代码]: [代码][代码]"https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzUxNDAzMzQ0MA==&scene=1"[代码][代码], [代码][代码]"scene"[代码] [代码]: [代码][代码]"1"[代码][代码], [代码][代码]"title"[代码] [代码]: [代码][代码]"?????????????"[代码][代码], [代码][代码]"data"[代码] [代码]: { [代码][代码]"content"[代码] [代码]: { [代码][代码]"value"[代码] [代码]: [代码][代码]"test test \n test test"[代码][代码], [代码][代码]"color"[代码] [代码]: [代码][代码]"#1B5E20"[代码] [代码]} } }[代码] 结果在微信里显示的一次性订阅消息并未出现消息内容, 哪里出问题了?谢谢 [图片]
2018-09-21 - 小程序无法上传
在开发工具后点代码上传,但在小程序管理页面没有找到上传的小程序。哪里出问题了?
2018-09-03 - Android移动应用调用一次性订阅消息出错
希望在微信里给APP的用户发消息 - 当前 Bug 的表现(可附上截图) 首先获取用户授权 [图片] 成功后在手机上通过接口 https://api.weixin.qq.com/cgi-bin/message/template/subscribe?access_token=13_yr-U5T9Z7sD9wK8t-b6CLlF37ptdzeeqWrqlM1_7ShilbZvJzofZyY97bqa30rg0M2MiJMHeJk0euVfexnN2M0rFCdREVo3S7S5bFKWcWzU 向微信API post数据 {"touser":"oKn3lvkut8w-H0oM2c-3Rhsqx70o", "template_id":"k5dLFam6GtlfptCMkbR02eqIeO22oNqn8SaL1bSSuc4", "url":"https:\/\/mp.weixin.qq.com\/s\/Ojd9nmggEPeLHHK1tJKGrQ", "scene":1, "title":"Hello world", "data":{"content":{"value":"data","color":"#ff0000"}} } 结果报错 {"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest hint: [o8Y_mA0765vr47!]"} 不知道是什么原因? 其中openid和access_token通过接口 String uri = String.format("https://api.weixin.qq.com/sns/auth?access_token=%s&openid=%s", weixinAccessToken, openId);验证通过。为什么还会报错? 代码 String verifyUri = String.format("https://api.weixin.qq.com/sns/auth?access_token=%s&openid=%s", weixinAccessToken, openId); String subscribeUri = "https://api.weixin.qq.com/cgi-bin/message/template/subscribe?access_token=" + weixinAccessToken; HttpsURLConnection urlConnection = null; try { // verify access token Log.d(TAG, "verify uri = " + verifyUri); URL verifyUrL = new URL(verifyUri); urlConnection = (HttpsURLConnection) verifyUrL.openConnection(); { InputStream in1 = new BufferedInputStream(urlConnection.getInputStream()); BufferedReader r = new BufferedReader(new InputStreamReader(in1)); StringBuilder total = new StringBuilder(); String line; while ((line = r.readLine()) != null) { total.append(line).append('\n'); } Log.d(TAG, "verify resp: " + total.toString()); } // subcribe wexin message Log.d(TAG, "subscribe uri = " + subscribeUri); URL subscribeUrl = new URL(subscribeUri); urlConnection = (HttpsURLConnection) subscribeUrl.openConnection(); // urlConnection.setSSLSocketFactory(httpsClient.getSslContext().getSocketFactory()); urlConnection.setReadTimeout(10000); urlConnection.setConnectTimeout(15000); urlConnection.setRequestMethod("POST"); urlConnection.setDoInput(true); urlConnection.setDoOutput(true); urlConnection.setUseCaches(false); urlConnection.setRequestProperty("Content-Type", "application/json"); urlConnection.setRequestProperty("Host", "android.schoolportal.gr"); urlConnection.connect(); // Send POST output. DataOutputStream printout = new DataOutputStream(urlConnection.getOutputStream()); Log.d(TAG, "post json data: " + postJson.toString()); printout.writeBytes(postJson.toString()); printout.flush(); printout.close(); InputStream in = new BufferedInputStream(urlConnection.getInputStream()); BufferedReader r = new BufferedReader(new InputStreamReader(in)); StringBuilder total = new StringBuilder(); String line; while ((line = r.readLine()) != null) { total.append(line).append('\n'); } Log.d(TAG, "subscribe resp: " + total.toString()); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ProtocolException e) { e.printStackTrace(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } logcat: 08-28 17:29:19.761 16784-16784/cn.com.hotcent.eyecare D/WXEntryActivity: handleIntent = true 08-28 17:29:19.761 16784-16991/cn.com.hotcent.eyecare D/HttpSubscribeWeixinMsgTask: verify uri = https://api.weixin.qq.com/sns/auth?access_token=13_K7D7F9nRL_fjy3Df9afmKW6XYCPv24d6FL-JJgojaek2qi3r7F37m2NaLOKfRaC47SUMfRIIIR9AzYND35-hdTWeSZVRIpfXi4JiGO4aWXg&openid=oKn3lvkut8w-H0oM2c-3Rhsqx70o 08-28 17:29:19.762 16784-16784/cn.com.hotcent.eyecare V/MicroMsg.SDK.WXApiImplV10.ActivityLifecycleCb: cn.com.hotcent.eyecare.wxapi.WXEntryActivity onActivityResumed 08-28 17:29:19.802 16784-16784/cn.com.hotcent.eyecare D/ActivityThreadInjector: clearCachedDrawables. 08-28 17:29:20.291 16784-16991/cn.com.hotcent.eyecare I/RestUtilImpl: Approving certificate for api.weixin.qq.com 08-28 17:29:20.430 16784-16991/cn.com.hotcent.eyecare D/HttpSubscribeWeixinMsgTask: verify resp: {"errcode":0,"errmsg":"ok"} subscribe uri = https://api.weixin.qq.com/cgi-bin/message/template/subscribe?access_token=13_K7D7F9nRL_fjy3Df9afmKW6XYCPv24d6FL-JJgojaek2qi3r7F37m2NaLOKfRaC47SUMfRIIIR9AzYND35-hdTWeSZVRIpfXi4JiGO4aWXg 08-28 17:29:20.477 16784-16991/cn.com.hotcent.eyecare D/HttpSubscribeWeixinMsgTask: post json data: {"touser":"oKn3lvkut8w-H0oM2c-3Rhsqx70o","template_id":"k5dLFam6GtlfptCMkbR02eqIeO22oNqn8SaL1bSSuc4","url":"https:\/\/mp.weixin.qq.com\/s\/Ojd9nmggEPeLHHK1tJKGrQ","scene":1,"title":"Hello world","data":{"content":{"value":"data","color":"#ff0000"}}} 08-28 17:29:20.545 16784-16991/cn.com.hotcent.eyecare D/HttpSubscribeWeixinMsgTask: subscribe resp: {"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest hint: [8mb_aa0559vr47!]"} 08-28 17:29:20.562 16784-16784/cn.com.hotcent.eyecare V/MicroMsg.SDK.WXApiImplV10.ActivityLifecycleCb: WXStat trigger onForeground
2018-08-28 - 小程序里html的操作
html是主流的文本形式。怎么在小程序里显示html页面,有没有现成的html文本编辑控件?
2016-12-29