We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No description provided.
The text was updated successfully, but these errors were encountered:
由于涉及到网络交互,wfc.getGroupInfo等接口是异步返回,会先返回本地的群信息,如果本地不存在该群信息的时候,会返回一个只包含groupId的NullGroupInfo对象,并从服务端去拉取该群的群信息,拉取成功之后,会通过EventType.GroupInfosUpdate进行通知,上层监听到EventType.GroupInfosUpdate之后,再次获取群信息即可。
wfc.getGroupInfo
groupId
NullGroupInfo
EventType.GroupInfosUpdate
此外,获取群信息还有另外一个方法:wfc.getGroupInfoEx。该方法通过回调返回群信息,当本地不存在该群信息的时候,会从服务端拉取,然后通过回调返回群信息。
wfc.getGroupInfoEx
Sorry, something went wrong.
补充一下,针对用户信息,也有一个类似的方法:getUserInfoEx
getUserInfoEx
一些参考代码:
// 在合适的地方添加事件监听,比如组件创建的时候 wfc.eventEmitter.on(EventType.UserInfosUpdate, this.onUserInfosUpdate); // .... onUserInfosUpdate(userInfos){ // 业务代码,比如更新 UI 等 } // 组件销毁的时候,记得删除监听,否则会造成内存泄漏 wfc.eventEmitter.removeListener(EventType.UserInfosUpdate, this.onUserInfosUpdate);
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: