Skip to content

快适配小游戏示例-调起小游戏订阅消息失败(requestSubscribeSystemMessage:fail require user interaction (only in touchend event)) #992

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

Open
wenboqiu opened this issue Apr 24, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@wenboqiu
Copy link

描述Bug

EventSystem下面已经挂载WXTouchInputOverride脚本,但是依旧触发requestSubscribeSystemMessage:fail require user interaction (only in touchend event)报错。

Image

运行环境

Unity2022.3.38, WX-SDK: 202504080206
@wenboqiu wenboqiu added the bug Something isn't working label Apr 24, 2025
@wenboqiu
Copy link
Author

看了下WXTouchInputOverride.OnWxTouchEnd函数的实现
int clickListenerCount = button.onClick.GetPersistentEventCount(); if (clickListenerCount > 0) { button.onClick.SetPersistentListenerState(0, UnityEventCallState.EditorAndRuntime); button.onClick.Invoke(); button.onClick.SetPersistentListenerState(0, UnityEventCallState.Off); }
看起来运行时注册的onclick事件不会在OnWxTouchEnd中触发,编辑器上在button的onclick上手动挂载事件,可以解决问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant