当前位置:网站首页>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({
// ...
})
边栏推荐
- 岁月匆匆那年
- @Bugs caused by improper use of configurationproperties
- 简单的页面
- [daily question 1] traversal of binary tree
- 【Proteus仿真】8位端口检测8独立按键
- DL:深度学习模型优化之模型训练技巧总结之适时自动调整学习率实现代码
- Time flies that year
- 岁月不饶人
- 如何在IDEA中自定義模板、快速生成完整的代碼?
- In 2022, the latest and most detailed idea associated database method and visual operation of database in idea (including graphic process)
猜你喜欢
随机推荐
Database learning notes (sql03)
在线文本数字识别列表求和工具
Traffic, but no sales? 6 steps to increase website sales
Common settings in idea
Using tsne to visualize the similarity of different sentences
[spark] basic Scala operations (continuous update)
Swift notes
leetcode-1. Sum of two numbers
[PHP] PHP pressure test, error reporting: generally, each socket address (Protocol / network address / port) is only allowed to be used
2022-06-29: x = {a, B, C, D}, y = {e, F, G, H}, the length of the two small arrays X and Y is 4. If yes: a + e = B + F = C + G = D + H
阿洛觉得自己迷茫
ML:置信区间的简介(精密度/准确度/精确度的三者区别及其关系)、使用方法、案例应用之详细攻略
赛芯电子冲刺科创板上市:拟募资6.23亿元,共有64项专利申请信息
Le module twincat 3 el7211 contrôle les servocommandes baffle
TwinCAT 3 EL7211模塊控制倍福伺服
How to design test cases
Comment personnaliser les modèles et générer rapidement le code complet dans l'idée?
Antd - tree structure: default deployment node attribute failure - Basic promotion
Outsourcing work for three years, waste a step confused
Transaction summary on June 25, 2022








