Giter VIP home page Giter VIP logo

Comments (4)

dujiepeng avatar dujiepeng commented on August 14, 2024

@abellee 因为flutter这一侧除了发送消息其他的都是从原生sdk去取,sdk内部这个状态是更新的。所以这个状态从sdk获取时会是正确的。

from im_flutter_sdk.

abellee avatar abellee commented on August 14, 2024

@dujiepeng 但是如果我不setMessageStatusCallback 直接获取状态,那状态就一直是onProgress的,
场景是:通过消息的状态来判断是否显示一个loading的动画图标,但做一个延迟(毫秒级)的状态检测,如果仍处在发送中,则显示loading,否则就不显示。
我觉得Flutter侧不应该纠结原生SDK,这样的处理也是有问题的,不论是否有回调,消息状态是必须要更新的吧。

from im_flutter_sdk.

dujiepeng avatar dujiepeng commented on August 14, 2024

@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.

abellee avatar abellee commented on August 14, 2024

@dujiepeng 感谢

from im_flutter_sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.