( 最近更新时间:2020-04-28 19:00:00 )
开发者 App Server 与融云 IM Server 如何建立关联 ? 具体可见: https://www.rongcloud.cn/docs/quick_start.html#app (opens new window)
会话列表如何显示头像和昵称 ? 1.app 层需从自己服务器获取用户信息
2.获取完信息后建议 app 层做本地存储和内存缓存
3.UI 渲染的时候,可以先从内存缓存获取用户信息,如果没有则从本地存储获取,如果还没有则需从自己服务器获取,然后做本地存储和内存缓存
多端登录时,如何同步未读数 ? 多端情况,需清除未读数时,通过发消息通知其他端,保持未读数一致。详情见: https://support.rongcloud.cn/ks/NjE0 (opens new window)
移动端切换用户,会话列表为何显示之前用户的会话内容 ? 会话数据是存储在本地数据库中,只有连接成功后(即拿到成功回调后),数据库才会切换到新用户的,所以可以在切换用户后(即新用户连接成后),刷新会话列表就会加载新用户的会话数据了。同时也可以设置会话列表对象的下面属性来增强用户体验
@property ( nonatomic,assign) BOOL showConversationListWhileLogOut;
1 2 3 4 5 6
在第一个帐号调用logout之后,会话列表 activity 调用finish()关闭activity,这样第二个帐号登录的时候activity和ConversationListFragment都会重新走生命周期重新加载。
如果因为种种原因不方便在logout的时候finish掉activity,那么可以在重新登录的时候在activity里使用下面代码重新加载fragment。
Uri uri = Uri . parse ( "rong://" + getApplicationInfo ( ) . packageName) . buildUpon ( )
. appendPath ( "conversationlist" )
. appendQueryParameter ( Conversation. ConversationType . PRIVATE. getName ( ) ,"false" )
. build ( ) ;
mConversationListFragment. setUri ( uri) ;
mConversationListFragment. onRestoreUI ( ) ;
1 2 3 4 5 6
IMKit 会话列表 Cell 是否可以自定义 ? iOS:
可以自定义,请参考文档:https://docs.rongcloud.cn/v3/views/im/ui/guide/private/list/custom/ios.html#customcell (opens new window)
Android:
继承 ConversationListFragment 或者继承 ConversationListAdapter 重写部分方法。具体可参考 Github (opens new window)
IMKit 会话列表为空时候的背景图是否可以替换 ? 参考下面的布局文件
< ? xml version= "1.0" encoding= "utf-8" ? >
< RelativeLayout xmlns: android= "http://schemas.android.com/apk/res/android"
xmlns: app= "http://schemas.android.com/apk/res-auto"
android: layout_width= "match_parent"
android: layout_height= "match_parent"
android: background= "@color/rc_normal_bg" >
< RelativeLayout
android: layout_width= "match_parent"
android: layout_height= "match_parent" >
< ScrollView
android: layout_width= "match_parent"
android: fillViewport= "true"
android: layout_height= "match_parent" >
< ImageView
android: id= "@+id/bg_conversation"
android: layout_width= "match_parent"
android: layout_height= "match_parent"
android: background= "@drawable/bg_conversation"
/ >
< / ScrollView >
< / RelativeLayout >
< include
android: id= "@id/rc_layout_msg_list"
layout= "@layout/rc_fr_messagelist"
android: layout_width= "match_parent"
android: layout_height= "match_parent"
android: layout_above= "@+id/rc_extension" / >
< io. rong. imkit. RongExtension
android: id= "@+id/rc_extension"
android: layout_alignParentBottom= "true"
android: layout_width= "match_parent"
android: layout_height= "wrap_content"
app: RCStyle = "SCE" / >
< / RelativeLayout >
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
IMKit 支持添加、修改、删除扩展板上的每一个扩展项,包括修改扩展项的图片、文案以及点击之后的响应事件处理
iOS:
iOS 自定义会话页面加号扩展模块
Android:
Android 自定义会话页面加号扩展模块
如何自定义 Emoji 表情 ?