Comments (4)
@abellee 因为flutter这一侧除了发送消息其他的都是从原生sdk去取,sdk内部这个状态是更新的。所以这个状态从sdk获取时会是正确的。
from im_flutter_sdk.
@dujiepeng 但是如果我不setMessageStatusCallback
直接获取状态,那状态就一直是onProgress
的,
场景是:通过消息的状态来判断是否显示一个loading的动画图标,但做一个延迟(毫秒级)的状态检测,如果仍处在发送中,则显示loading,否则就不显示。
我觉得Flutter侧不应该纠结原生SDK,这样的处理也是有问题的,不论是否有回调,消息状态是必须要更新的吧。
from im_flutter_sdk.
@abellee 你说的这个场景是需要设置statusCallback的。
你说的情况我非常同意,之前有一个版本是按照这个实现的,但是flutter中消息结构都是new出来的,如果sdk直接持有了消息,它和ui上持有的很可能不是一份(因为ui更新时可能会重新从sdk load,而load出来的都是new的)。这就导致sdk更新了消息状态,你持有的不会更新。所以必须要求你显式的把这个callback设置给sdk,sdk才能才得到回调时更新你持有的。
另外,也有考虑把整个消息状态提高,从现在的针对message 的callback放到EMChatManager这个级别,但目前原生那边不保留messageId,也就是说消息发送的时候是messageid是1,发送成功后就直接变成了2,没有对应关系,这就会导致提到EMChatManager后,无法对应是哪一条消息发送成功。所以目前只能这样实现,我也和原生同步了这个情况,也期待他们有这个处理。
from im_flutter_sdk.
@dujiepeng 感谢
from im_flutter_sdk.
Related Issues (20)
- im_flutter_sdk: ^3.8.3+4 无法使用多人音视频
- iOS 下无法编译的问题 HOT 2
- 无法在离线时收到好友请求 HOT 2
- 请教下在哪里监听即时推送的内容
- 获取msgTime报错 HOT 4
- 接收好友邀请回调不正常 HOT 5
- 3.9.0+1没有startCallback方法 HOT 1
- 请问一下 EMOptions 如何更新 HOT 2
- 请问如何获取群组EMGroupOptions? HOT 1
- 调用登录相关SDK耗时太长 HOT 2
- 关于vivo 华为推送设置 HOT 1
- sqlite out of memory 导致APP闪退 HOT 2
- processGeneralRESTResponseError:: retCode: 408 response: timeout HOT 3
- 消息不回调 HOT 3
- 关于模拟器下的监听问题 HOT 1
- 上传群共享文件的进度回调在哪? HOT 2
- There is no HyphenateChat (= 3.9.3.1) in CocoaPods HOT 5
- Whether to support the web version HOT 2
- 登录提示null引用 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from im_flutter_sdk.