Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fly + wx.requestSubscribeMessage = fail can only be invoked by user TAP gesture #275

Open
tryingpzm opened this issue Jun 13, 2021 · 0 comments

Comments

@tryingpzm
Copy link

tryingpzm commented Jun 13, 2021

操作路径:用户点击回调 -> await ajax -> wx.requestSubscribeMessage

ajax用flyio实现时会报错:requestSubscribeMessage:fail can only be invoked by user TAP gesture(开发者工具以及真机调试都报错),如果用原生或者 minapp-api-promise则不会,测试发现是内部setTimeout导致的,等于到了下个宏任务才执行,目前看来这触发了wx.requestSubscribeMessage判断是否用户真实点击的机制

导致问题代码:
setTimeout(function () {
engine.send(needQuery ? null : data);
}, 0);

@tryingpzm tryingpzm reopened this Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant