Micro letter template messages applet and applet subscribe messaging

Subscribe to news applet
Features
messaging capabilities is an important component in the ability of small programs, we offer a subscription messaging capabilities for developers, in order to achieve closed-loop experience and better service.

Service Notification: Subscribe message push position
issued under the conditions of the subscription message: subscribe user self-
subscribe messaging capability the card Jump: Click here for details jump to the applet page

file

Instructions for use
Step one: get the template ID
in manual micro-channel public platform configuration acquisition template ID:
Login https://mp.weixin.qq.com acquisition template, if no suitable template, you can apply to add a new template, can be used after approval .

Step Two: acquiring a rights
see applet end subscription message interfaces wx.requestSubscribeMessage

Step Three: Call Interface subscribe message issued
detailed server messaging interface subscribeMessage.send

wx.requestSubscribeMessage (Object object)
underlying library 2.8.2 started to support low version is compatible with processing to be done.

Note: 2.8.2 version, the user clicks occur or initiate a callback after the payment, can transfer from a subscription message interface.

Parameter
Object object

Attribute Type Default Required Description
disposable iOS client 7.0.6 version, Android version 7.0.7 client after: tmplIds Array is a collection of subscription-id message template, one call can subscribe to up to 3 messages (note Subscribe / long-term subscription only supports multiple templates messages, iOS client 7.0.5 version, Android client a subscription prior to 7.0.6 version only supports a template message) in the message template id [micro letter public platform (mp.weixin.qq .com) - function - subscribe message] configuration

Property Type Description
when errMsg String interface call is successful errMsg 'requestSubscribeMessage: ok'

TEMPLATE_ID String [TEMPLATE_ID] key is dynamic, i.e. the template id, value comprises 'accept', 'reject', 'ban'. 'Accept' the user agrees to subscribe to the article id corresponding template messages, 'reject' user has refused to subscribe to the article id corresponding template messages, 'ban' representation has been banned background. For example {errMsg: "requestSubscribeMessage: ok", zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE: "accept"} represents user subscribing zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE this message

Sample Code

wx.requestSubscribeMessage({
  tmplIds: [''],
  success (res) { }
})

Wx.requestSubscribeMessage number of clicks and receive proportional to push subscription information?

Black Dian Yang 11-082004 browsing issues modules: API and components

Recently doing a project because it needs to use the push function, and community chiefs and I said micro-channel subscription opened, I was happy to go with, and tried really incense down, eliminating the need to obtain formid cumbersome restrictions in 7 days limiting step, but the test of time today back to my ordinary error, and finally click once found wx.requestSubscribeMessage will receive a push, I was capitalized blacks face a question mark, then I want to ask, since this is the case this thing clicks to remember What is the use of selected operations? If the customer needs just that little bit bound program has been in operation is not the pc can only receive a message? Or I should write a few hundred cycles at the click of subscription time and then let the customers on a regular basis to the point again? I feel very unreasonable ah, there is no official of the god to me about?

wx.requestSubscribeMessage call the question?

dio10-161704 browsing issues modules: API and components

After measurement, id number is not larger than the configured tmplIds 3 normal call,

The configuration can not be more than 3 id after invoking authorization bomb box, if there are restrictions on the number of messages each authorized ask more subscribers?

Call wx.requestSubscribeMessage been an error?
MR.C11-28221 browsing issues modules: API and components
have been reported this error {errMsg: "requestSubscribeMessage: fail can only be invoked by user TAP gesture."}

file

Before now it is to call the dynamic backend interface getTemplate get tmplIDs, again calling requestSubscribeMessage, an error has been found, but if you write the error will not die tmpllDs the authorization box pops up, click on the interface is a trigger event, this request is requestSubscribeMessage Interface other requests can not have it?

subscribeMessage.send
this interface shall call on the server side, a detailed description see the server API.

本接口支持云调用。需开发者工具版本 >= 1.02.1904090(最新稳定版下载),wx-server-sdk >= 0.4.0

发送订阅消息

使用说明
步骤一:获取模板 ID
有两个方法可以获取模板 ID:

通过模板消息管理接口获取模板 ID(详见 模板消息管理)
在微信公众平台手动配置获取模板 ID
登录 https://mp.weixin.qq.com 获取模板,如果没有合适的模板,可以申请添加新模板,审核通过后可使用,详见 模板审核说明

步骤二:页面的 form 组件,属性 report-submit 为 true 时,可以声明为需要发送模板消息,此时点击按钮提交表单可以获取 formId,用于发送模板消息。或者当用户完成 支付行为,可以获取 prepay_id 用于发送模板消息。
步骤三:调用接口下发模板消息(详见 templateMessage.send )
使用效果

❤️ 不要忘记留下你学习的脚印 [点赞 + 收藏 + 评论]

作者Info:

【作者】:Jeskson
【原创公众号】:达达前端小酒馆。
【福利】:公众号回复 “资料” 送自学资料大礼包(进群分享,想要啥就说哈,看我有没有)!
【转载说明】:转载请说明出处,谢谢合作!~

大前端开发,定位前端开发技术栈博客,PHP后台知识点,web全栈技术领域,数据结构与算法、网络原理等通俗易懂的呈现给小伙伴。谢谢支持,承蒙厚爱!!!


若本号内容有做得不到位的地方(比如:涉及版权或其他问题),请及时联系我们进行整改即可,会在第一时间进行处理。


请点赞!因为你们的赞同/鼓励是我写作的最大动力!

Welcome attention to Dada 's CSDN!

This is a quality, attitude blog

Front-end technology stack

Guess you like

Origin www.cnblogs.com/dashucoding/p/12013667.html