当前位置:网站首页>Wechat applet - requestsubscribemessage:fail can only be invoked by user tap gesture
Wechat applet - requestsubscribemessage:fail can only be invoked by user tap gesture
2022-06-30 00:51:00 【Wangjiabin】
Preface
Use wx.requestSubscribeMessage() API, Call up the client applet subscription message interface , Has been an error :
requestSubscribeMessage:fail can only be invoked by user TAP gesture.
# requestSubscribeMessage:fail It can only be called by the user's click gesture .
And no error code , As shown in the figure below :
Solution
actually , It's just that
APIYou placed Callback function in , Just place it on the outside .
for example , My error code example , Because it is placed in the callback function , As shown in the following code :
// I need to call the interface , Get the template id, So it is set in the callback function .
$http.fly.get('index.php', data).then((res) => {
// wx.requestSubscribeMessage({})
})
Just move it outside the callback function , As shown in the following code :
$http.fly.get('index.php', data).then((res) => {
// ...
})
// Put it outside
wx.requestSubscribeMessage({
// ...
})
边栏推荐
- 太卷了~ 八股文,面试最强王者!
- Quick Pow: 如何快速求幂
- [PHP] PHP pressure test, error reporting: generally, each socket address (Protocol / network address / port) is only allowed to be used
- 利用huggingface进行文本分类
- 测试用例设计方法之等价类划分方法
- Lower expectations
- shell 规范日期格式
- Interviewer: why does database connection consume resources? I can't even answer.. I was stunned!
- Byte, word, doubleword relationship
- Yunna | how to use the system to manage fixed assets? How to manage fixed assets?
猜你喜欢

月薪没到30K的程序员必须要背的面试八股,我先啃为敬!

如何在IDEA中创建Module、以及怎样在IDEA中删除Module?

Simple pages

How to view the size of all files in a folder?

Yunna | fixed assets system management, NC system management where are the fixed assets

简单的页面

IDEA中的常用设置

练习副“产品”:自制七彩提示字符串展示工具(for循环、if条件判断)

如何在IDEA中自定义模板、快速生成完整的代码?

Use of shortcut keys for idea tools
随机推荐
Which direction of network development is better? Data communication engineer learning path sharing
[spark] basic Scala operations (continuous update)
The third bullet of wechat payment app application for refund
What is the essential difference between get and post requests?
岁月不饶人
Briefly: how are fragments communicated?
Swift notes
How to seamlessly transition from traditional microservice framework to service grid ASM
Experience of C language course design: open source sharing of "push box" course design works
YuMinHong: my retreat and advance; The five best software architecture patterns that architects must understand; Redis kills 52 consecutive questions | manong weekly VIP member exclusive email weekly
[programming problem] maze problem
How about stock online account opening and account opening process? Also, is it safe to open an account online?
干外包3年,真废了...
Practical application of information security
Distributed task scheduling elasticjob demo
C语言课设心得之“推箱子”课设作品开源分享
Time does not spare
如何查看一个文件夹下所有文件的大小?
[mrctf2020]ezpop-1 | PHP serialization
视频转图像-cv2.VideoCapture()用法