Closed daweibayu closed 8 years ago
ChatManager 中是否需要增加一个 getCurrentUserId 的方法?我想你在 ChatActivity 里面为了展示消息列表,肯定是需要拿到 currentUserId 的,不知道在现有接口下会如何获取?
open 的时候会传入 currentUserId,根据这个 id 以及 getProfiles() 可以获取当单签用户的信息。
你可以把工程框架和这部分接口的代码发个 PR 上来了。有关处理细节在 PR 上去讨论。
具体上下文可参照 https://github.com/leancloud/paas/issues/816 、#1 ,以下为具体设计
ChatManager (以下函数依次调用即可 )
1.获取单例
2.初始化
3.设置用户体系
4.设置签名
5.开启聊天
6.关闭聊天
ProfileProvider 相关
用户需要自己实现接口
CallBack
UserProfile 的相关属性
UI 相关
1.ConversationFragment 作用:展示所有 conversation list 的 fragment(需要 open 后才会执行相关逻辑 ) 参数:无 函数:updateFragment() 主动刷新 Fragment
2.ChatActivity 作用:聊天页面,只要发起 StartActivity,并且 Intent 中包含以下参数即可 参数:Constants.MEMBER_ID、Constants.CONVERSATION_ID(二选一即可) Action:Constants.AVATAR_CLICK_EVENT(头像点击事件)
其他